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();
|
||||
}
|
||||
}
|
@@ -30,7 +30,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;
|
||||
@@ -139,7 +138,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);
|
||||
@@ -466,7 +465,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();
|
||||
|
||||
|
@@ -20,7 +20,6 @@ import java.util.List;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.WalkerRouteData;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.NpcWalkerNode;
|
||||
@@ -92,7 +91,7 @@ public class NpcWalkerAI extends CreatureAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
if (_nextMoveTime < Chronos.currentTimeMillis())
|
||||
if (_nextMoveTime < System.currentTimeMillis())
|
||||
{
|
||||
walkToLocation();
|
||||
}
|
||||
@@ -155,7 +154,7 @@ public class NpcWalkerAI extends CreatureAI implements Runnable
|
||||
delay = DEFAULT_MOVE_DELAY;
|
||||
}
|
||||
|
||||
_nextMoveTime = Chronos.currentTimeMillis() + delay;
|
||||
_nextMoveTime = System.currentTimeMillis() + delay;
|
||||
setWalkingToNextPoint(false);
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
@@ -42,7 +41,7 @@ public class WarehouseCacheManager
|
||||
|
||||
public void addCacheTask(Player pc)
|
||||
{
|
||||
_cachedWh.put(pc, Chronos.currentTimeMillis());
|
||||
_cachedWh.put(pc, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void remCacheTask(Player pc)
|
||||
@@ -55,7 +54,7 @@ public class WarehouseCacheManager
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final long cTime = Chronos.currentTimeMillis();
|
||||
final long cTime = System.currentTimeMillis();
|
||||
for (Entry<Player, Long> entry : _cachedWh.entrySet())
|
||||
{
|
||||
if ((cTime - entry.getValue().longValue()) > _cacheTime)
|
||||
|
@@ -30,7 +30,6 @@ import java.util.regex.PatternSyntaxException;
|
||||
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.instancemanager.FortManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.IdManager;
|
||||
@@ -81,7 +80,7 @@ public class ClanTable
|
||||
clan = getClan(Integer.parseInt(result.getString("clan_id")));
|
||||
if (clan.getDissolvingExpiryTime() != 0)
|
||||
{
|
||||
if (clan.getDissolvingExpiryTime() < Chronos.currentTimeMillis())
|
||||
if (clan.getDissolvingExpiryTime() < System.currentTimeMillis())
|
||||
{
|
||||
destroyClan(clan.getClanId());
|
||||
}
|
||||
@@ -180,7 +179,7 @@ public class ClanTable
|
||||
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;
|
||||
@@ -409,7 +408,7 @@ public class ClanTable
|
||||
{
|
||||
destroyClan(clanId);
|
||||
}
|
||||
}, getClan(clanId).getDissolvingExpiryTime() - Chronos.currentTimeMillis());
|
||||
}, getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public boolean isAllyExists(String allyName)
|
||||
|
@@ -26,7 +26,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.LoginServerThread;
|
||||
import org.l2jmobius.gameserver.model.ManufactureItem;
|
||||
import org.l2jmobius.gameserver.model.ManufactureList;
|
||||
@@ -178,7 +177,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;
|
||||
}
|
||||
|
@@ -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.gameserver.data.ItemTable;
|
||||
import org.l2jmobius.gameserver.model.StoreTradeList;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
@@ -158,7 +157,7 @@ public class TradeListTable
|
||||
{
|
||||
int time = 0;
|
||||
long savetimer = 0;
|
||||
final long currentMillis = Chronos.currentTimeMillis();
|
||||
final long currentMillis = System.currentTimeMillis();
|
||||
final PreparedStatement statement2 = con.prepareStatement("SELECT DISTINCT time, savetimer FROM " + (custom ? "custom_merchant_buylists" : "merchant_buylists") + " WHERE time <> 0 ORDER BY time");
|
||||
final ResultSet rset2 = statement2.executeQuery();
|
||||
|
||||
@@ -168,7 +167,7 @@ public class TradeListTable
|
||||
savetimer = rset2.getLong("savetimer");
|
||||
if ((savetimer - currentMillis) > 0)
|
||||
{
|
||||
ThreadPool.schedule(new RestoreCount(time), savetimer - Chronos.currentTimeMillis());
|
||||
ThreadPool.schedule(new RestoreCount(time), savetimer - System.currentTimeMillis());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -223,7 +222,7 @@ public class TradeListTable
|
||||
|
||||
protected void dataTimerSave(int time)
|
||||
{
|
||||
final long timerSave = Chronos.currentTimeMillis() + (time * 3600000); // 60*60*1000
|
||||
final long timerSave = System.currentTimeMillis() + (time * 3600000); // 60*60*1000
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection())
|
||||
{
|
||||
|
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.handler.admincommandhandlers;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
@@ -62,7 +61,7 @@ public class AdminDonator implements IAdminCommandHandler
|
||||
{
|
||||
targetPlayer.setDonator(true);
|
||||
targetPlayer.updateNameTitleColor();
|
||||
targetPlayer.getVariables().set("CustomDonatorEnd", Chronos.currentTimeMillis() + donatorTime);
|
||||
targetPlayer.getVariables().set("CustomDonatorEnd", System.currentTimeMillis() + donatorTime);
|
||||
targetPlayer.sendMessage(activeChar.getName() + " has granted you donator status!");
|
||||
activeChar.sendMessage("You have granted donator status to " + targetPlayer.getName());
|
||||
AdminData.broadcastMessageToGMs("Warn: " + activeChar.getName() + " has set " + targetPlayer.getName() + " as donator !");
|
||||
|
@@ -29,7 +29,6 @@ import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.GameServer;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
import org.l2jmobius.gameserver.data.xml.AdminData;
|
||||
@@ -74,7 +73,7 @@ public class AdminServerInfo implements IAdminCommandHandler
|
||||
html.replace("%gameTime%", GameTimeTaskManager.getInstance().getGameHour() + ":" + GameTimeTaskManager.getInstance().getGameMinute());
|
||||
html.replace("%dayNight%", GameTimeTaskManager.getInstance().isNight() ? "Night" : "Day");
|
||||
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
|
||||
html.replace("%serverTime%", SDF.format(new Date(Chronos.currentTimeMillis())));
|
||||
html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
|
||||
html.replace("%serverUpTime%", getServerUpTime());
|
||||
html.replace("%onlineAll%", getPlayersCount("ALL"));
|
||||
html.replace("%offlineTrade%", getPlayersCount("OFF_TRADE"));
|
||||
@@ -101,7 +100,7 @@ public class AdminServerInfo implements IAdminCommandHandler
|
||||
|
||||
private String getServerUpTime()
|
||||
{
|
||||
long time = Chronos.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
|
||||
long time = System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis();
|
||||
|
||||
final long days = TimeUnit.MILLISECONDS.toDays(time);
|
||||
time -= TimeUnit.DAYS.toMillis(days);
|
||||
|
@@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.handler.itemhandlers;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -66,7 +65,7 @@ public class HeroCustomItem implements IItemHandler
|
||||
|
||||
final long heroTime = Config.HERO_CUSTOM_DAY * 24 * 60 * 60 * 1000;
|
||||
player.getVariables().set("CustomHero", true);
|
||||
player.getVariables().set("CustomHeroEnd", heroTime == 0 ? 0 : Chronos.currentTimeMillis() + heroTime);
|
||||
player.getVariables().set("CustomHeroEnd", heroTime == 0 ? 0 : System.currentTimeMillis() + heroTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.handler.itemhandlers;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.DoorData;
|
||||
import org.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
@@ -72,7 +71,7 @@ public class MOSKey implements IItemHandler
|
||||
return;
|
||||
}
|
||||
|
||||
if ((_lastOpen + 1800000) > Chronos.currentTimeMillis()) // 30 * 60 * 1000 = 1800000
|
||||
if ((_lastOpen + 1800000) > System.currentTimeMillis()) // 30 * 60 * 1000 = 1800000
|
||||
{
|
||||
player.sendMessage("You can`t use the key right now.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
@@ -91,7 +90,7 @@ public class MOSKey implements IItemHandler
|
||||
DoorData.getInstance().getDoor(23150003).onOpen();
|
||||
DoorData.getInstance().getDoor(23150004).onOpen();
|
||||
player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
|
||||
_lastOpen = Chronos.currentTimeMillis();
|
||||
_lastOpen = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.handler.usercommandhandlers;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
@@ -50,19 +49,19 @@ public class ClanPenalty implements IUserCommandHandler
|
||||
htmlContent.append("<tr><td width=170>Penalty</td>");
|
||||
htmlContent.append("<td width=100 align=center>Expiration Date</td></tr>");
|
||||
htmlContent.append("</table><table width=270 border=0><tr>");
|
||||
if (player.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (player.getClanJoinExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
htmlContent.append("<td width=170>Unable to join a clan.</td>");
|
||||
htmlContent.append("<td width=100 align=center>" + format.format(player.getClanJoinExpiryTime()) + "</td>");
|
||||
penalty = true;
|
||||
}
|
||||
if (player.getClanCreateExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (player.getClanCreateExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
htmlContent.append("<td width=170>Unable to create a clan.</td>");
|
||||
htmlContent.append("<td width=100 align=center>" + format.format(player.getClanCreateExpiryTime()) + "</td>");
|
||||
penalty = true;
|
||||
}
|
||||
if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > Chronos.currentTimeMillis()))
|
||||
if ((player.getClan() != null) && (player.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
|
||||
{
|
||||
htmlContent.append("<td width=170>Unable to invite a clan member.</td>");
|
||||
htmlContent.append("<td width=100 align=center>");
|
||||
|
@@ -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.util.PrimeFinder;
|
||||
|
||||
/**
|
||||
@@ -81,7 +80,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
|
||||
@@ -125,7 +124,7 @@ public class IdManager
|
||||
cleanCount += statement.executeUpdate("DELETE FROM items WHERE items.owner_id NOT IN (SELECT charId FROM characters) AND items.owner_id NOT IN (SELECT clan_id FROM clan_data);");
|
||||
statement.executeUpdate("UPDATE characters SET clanid=0 WHERE characters.clanid 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)
|
||||
{
|
||||
@@ -140,7 +139,7 @@ public class IdManager
|
||||
{
|
||||
try (PreparedStatement statement = con.prepareStatement(line))
|
||||
{
|
||||
statement.setLong(1, Chronos.currentTimeMillis());
|
||||
statement.setLong(1, System.currentTimeMillis());
|
||||
cleanCount += statement.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,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.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
@@ -96,7 +95,7 @@ public class ItemsOnGroundManager
|
||||
}
|
||||
|
||||
final PreparedStatement statement = con.prepareStatement(str);
|
||||
statement.setLong(1, Chronos.currentTimeMillis());
|
||||
statement.setLong(1, System.currentTimeMillis());
|
||||
statement.execute();
|
||||
statement.close();
|
||||
}
|
||||
|
@@ -25,7 +25,6 @@ import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -74,7 +73,7 @@ public class PetitionManager
|
||||
|
||||
private class Petition
|
||||
{
|
||||
private final long _submitTime = Chronos.currentTimeMillis();
|
||||
private final long _submitTime = System.currentTimeMillis();
|
||||
|
||||
private final int _id;
|
||||
private final PetitionType _type;
|
||||
|
@@ -27,7 +27,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.model.StoreTradeList;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
@@ -181,7 +180,7 @@ public class TradeManager
|
||||
{
|
||||
int time = 0;
|
||||
long savetimer = 0;
|
||||
final long currentMillis = Chronos.currentTimeMillis();
|
||||
final long currentMillis = System.currentTimeMillis();
|
||||
final PreparedStatement statement2 = con.prepareStatement("SELECT DISTINCT time, savetimer FROM merchant_buylists WHERE time <> 0 ORDER BY time");
|
||||
final ResultSet rset2 = statement2.executeQuery();
|
||||
|
||||
@@ -342,7 +341,7 @@ public class TradeManager
|
||||
{
|
||||
int time = 0;
|
||||
long savetimer = 0;
|
||||
final long currentMillis = Chronos.currentTimeMillis();
|
||||
final long currentMillis = System.currentTimeMillis();
|
||||
final PreparedStatement statement2 = con.prepareStatement("SELECT DISTINCT time, savetimer FROM custom_merchant_buylists WHERE time <> 0 ORDER BY time");
|
||||
final ResultSet rset2 = statement2.executeQuery();
|
||||
|
||||
@@ -428,7 +427,7 @@ public class TradeManager
|
||||
|
||||
public void dataTimerSave(int time)
|
||||
{
|
||||
final long timerSave = Chronos.currentTimeMillis() + (time * 60 * 60 * 1000);
|
||||
final long timerSave = System.currentTimeMillis() + (time * 60 * 60 * 1000);
|
||||
try (Connection con = DatabaseFactory.getConnection())
|
||||
{
|
||||
final PreparedStatement statement = con.prepareStatement("UPDATE merchant_buylists SET savetimer=? WHERE time=?");
|
||||
|
@@ -24,7 +24,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
|
||||
/**
|
||||
* @author Shyla
|
||||
@@ -163,7 +162,7 @@ public class EventsGlobalTask implements Runnable
|
||||
}
|
||||
|
||||
final Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(Chronos.currentTimeMillis());
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
|
||||
final int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
final int min = calendar.get(Calendar.MINUTE);
|
||||
|
@@ -26,7 +26,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.sql.AnnouncementsTable;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
@@ -60,7 +59,7 @@ public class Lottery
|
||||
_prize = Config.ALT_LOTTERY_PRIZE;
|
||||
_isSellingTickets = false;
|
||||
_isStarted = false;
|
||||
_enddate = Chronos.currentTimeMillis();
|
||||
_enddate = System.currentTimeMillis();
|
||||
if (Config.ALLOW_LOTTERY)
|
||||
{
|
||||
new startLottery().run();
|
||||
@@ -137,7 +136,7 @@ public class Lottery
|
||||
{
|
||||
_prize = rset.getInt("prize");
|
||||
_enddate = rset.getLong("enddate");
|
||||
if (_enddate <= (Chronos.currentTimeMillis() + (2 * MINUTE)))
|
||||
if (_enddate <= (System.currentTimeMillis() + (2 * MINUTE)))
|
||||
{
|
||||
new finishLottery().run();
|
||||
rset.close();
|
||||
@@ -146,14 +145,14 @@ public class Lottery
|
||||
return;
|
||||
}
|
||||
|
||||
if (_enddate > Chronos.currentTimeMillis())
|
||||
if (_enddate > System.currentTimeMillis())
|
||||
{
|
||||
_isStarted = true;
|
||||
ThreadPool.schedule(new finishLottery(), _enddate - Chronos.currentTimeMillis());
|
||||
if (_enddate > (Chronos.currentTimeMillis() + (12 * MINUTE)))
|
||||
ThreadPool.schedule(new finishLottery(), _enddate - System.currentTimeMillis());
|
||||
if (_enddate > (System.currentTimeMillis() + (12 * MINUTE)))
|
||||
{
|
||||
_isSellingTickets = true;
|
||||
ThreadPool.schedule(new stopSellingTickets(), _enddate - Chronos.currentTimeMillis() - (10 * MINUTE));
|
||||
ThreadPool.schedule(new stopSellingTickets(), _enddate - System.currentTimeMillis() - (10 * MINUTE));
|
||||
}
|
||||
rset.close();
|
||||
statement.close();
|
||||
@@ -190,8 +189,8 @@ public class Lottery
|
||||
_enddate = finishtime.getTimeInMillis();
|
||||
}
|
||||
|
||||
ThreadPool.schedule(new stopSellingTickets(), _enddate - Chronos.currentTimeMillis() - (10 * MINUTE));
|
||||
ThreadPool.schedule(new finishLottery(), _enddate - Chronos.currentTimeMillis());
|
||||
ThreadPool.schedule(new stopSellingTickets(), _enddate - System.currentTimeMillis() - (10 * MINUTE));
|
||||
ThreadPool.schedule(new finishLottery(), _enddate - System.currentTimeMillis());
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection())
|
||||
{
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
|
||||
/**
|
||||
* Simple class containing all necessary information to maintain<br>
|
||||
@@ -34,7 +33,7 @@ public class Timestamp
|
||||
{
|
||||
_skill = skill;
|
||||
_reuse = reuse;
|
||||
_stamp = Chronos.currentTimeMillis() + _reuse;
|
||||
_stamp = System.currentTimeMillis() + _reuse;
|
||||
}
|
||||
|
||||
public Timestamp(Skill skill, long reuse, long stamp)
|
||||
@@ -99,7 +98,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;
|
||||
@@ -117,7 +116,7 @@ public class Timestamp
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final boolean hasNotPassed = Chronos.currentTimeMillis() < _stamp;
|
||||
final boolean hasNotPassed = System.currentTimeMillis() < _stamp;
|
||||
if (!hasNotPassed)
|
||||
{
|
||||
_stamp = 0;
|
||||
|
@@ -23,7 +23,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.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.AttackableAI;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -408,7 +407,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.broadcastToChannelMembers(new CreatureSay(0, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
|
||||
}
|
||||
@@ -417,7 +416,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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2701,7 +2700,7 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if ((Chronos.currentTimeMillis() - _monster.getCommandChannelLastAttack()) > 900000)
|
||||
if ((System.currentTimeMillis() - _monster.getCommandChannelLastAttack()) > 900000)
|
||||
{
|
||||
_monster.setCommandChannelTimer(null);
|
||||
_monster.setFirstCommandChannelAttacked(null);
|
||||
|
@@ -32,7 +32,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.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.AttackableAI;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -8579,12 +8578,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
|
||||
public void reduceCurrentHpByDamOverTime(double amount, Creature attacker, boolean awake, int period)
|
||||
{
|
||||
if (_nextReducingHPByOverTime > Chronos.currentTimeMillis())
|
||||
if (_nextReducingHPByOverTime > System.currentTimeMillis())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_nextReducingHPByOverTime = Chronos.currentTimeMillis() + (period * 880);
|
||||
_nextReducingHPByOverTime = System.currentTimeMillis() + (period * 880);
|
||||
reduceCurrentHp(amount, attacker, awake);
|
||||
}
|
||||
|
||||
@@ -8592,12 +8591,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
|
||||
public void reduceCurrentMpByDamOverTime(double amount, int period)
|
||||
{
|
||||
if (_nextReducingMPByOverTime > Chronos.currentTimeMillis())
|
||||
if (_nextReducingMPByOverTime > System.currentTimeMillis())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_nextReducingMPByOverTime = Chronos.currentTimeMillis() + (period * 880);
|
||||
_nextReducingMPByOverTime = System.currentTimeMillis() + (period * 880);
|
||||
reduceCurrentMp(amount);
|
||||
}
|
||||
|
||||
@@ -8951,7 +8950,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
*/
|
||||
public void updateAttackStance()
|
||||
{
|
||||
attackStance = Chronos.currentTimeMillis();
|
||||
attackStance = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -22,7 +22,6 @@ import java.util.List;
|
||||
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.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
@@ -135,7 +134,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;
|
||||
@@ -578,7 +577,7 @@ public class Npc extends Creature
|
||||
@Override
|
||||
public void onAction(Player player)
|
||||
{
|
||||
if (!canTarget(player) || ((Chronos.currentTimeMillis() - player.getTimerToAttack()) < Config.CLICK_TASK))
|
||||
if (!canTarget(player) || ((System.currentTimeMillis() - player.getTimerToAttack()) < Config.CLICK_TASK))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -611,7 +610,7 @@ public class Npc extends Creature
|
||||
player.sendPacket(new MyTargetSelected(getObjectId(), 0));
|
||||
}
|
||||
|
||||
player.setTimerToAttack(Chronos.currentTimeMillis());
|
||||
player.setTimerToAttack(System.currentTimeMillis());
|
||||
// Send a Server->Client packet ValidateLocation to correct the Npc position and heading on the client
|
||||
player.sendPacket(new ValidateLocation(this));
|
||||
}
|
||||
@@ -848,7 +847,7 @@ public class Npc extends Creature
|
||||
player.sendPacket(new MyTargetSelected(getObjectId(), 0));
|
||||
}
|
||||
|
||||
player.setTimerToAttack(Chronos.currentTimeMillis());
|
||||
player.setTimerToAttack(System.currentTimeMillis());
|
||||
player.sendPacket(new ValidateLocation(this));
|
||||
}
|
||||
else
|
||||
|
@@ -35,7 +35,6 @@ import java.util.concurrent.TimeUnit;
|
||||
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.LoginServerThread;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -915,7 +914,7 @@ public class Player extends Playable
|
||||
}
|
||||
getFreight().restore();
|
||||
|
||||
_instanceLoginTime = Chronos.currentTimeMillis();
|
||||
_instanceLoginTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -931,7 +930,7 @@ public class Player extends Playable
|
||||
super.initCharStatusUpdateValues();
|
||||
initPcStatusUpdateValues();
|
||||
|
||||
_instanceLoginTime = Chronos.currentTimeMillis();
|
||||
_instanceLoginTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2977,7 +2976,7 @@ public class Player extends Playable
|
||||
public void setOnlineTime(long time)
|
||||
{
|
||||
_onlineTime = time;
|
||||
_onlineBeginTime = Chronos.currentTimeMillis();
|
||||
_onlineBeginTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public long getOnlineTime()
|
||||
@@ -6189,7 +6188,7 @@ public class Player extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
setPvpFlagLasts(Chronos.currentTimeMillis() + Config.PVP_NORMAL_TIME);
|
||||
setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
|
||||
if (getPvpFlag() == 0)
|
||||
{
|
||||
startPvPFlag();
|
||||
@@ -6231,11 +6230,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 (getPvpFlag() == 0)
|
||||
{
|
||||
@@ -6965,7 +6964,7 @@ public class Player extends Playable
|
||||
*/
|
||||
public long getUptime()
|
||||
{
|
||||
return Chronos.currentTimeMillis() - _uptime;
|
||||
return System.currentTimeMillis() - _uptime;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -7286,7 +7285,7 @@ public class Player extends Playable
|
||||
{
|
||||
final PreparedStatement statement = con.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?");
|
||||
statement.setInt(1, isOnline() ? 1 : 0);
|
||||
statement.setLong(2, Chronos.currentTimeMillis());
|
||||
statement.setLong(2, System.currentTimeMillis());
|
||||
statement.setInt(3, getObjectId());
|
||||
statement.execute();
|
||||
statement.close();
|
||||
@@ -7306,7 +7305,7 @@ public class Player extends Playable
|
||||
{
|
||||
final PreparedStatement statement = con.prepareStatement("UPDATE characters SET isIn7sDungeon=?, lastAccess=? WHERE charId=?");
|
||||
statement.setInt(1, isIn7sDungeon() ? 1 : 0);
|
||||
statement.setLong(2, Chronos.currentTimeMillis());
|
||||
statement.setLong(2, System.currentTimeMillis());
|
||||
statement.setInt(3, getObjectId());
|
||||
statement.execute();
|
||||
statement.close();
|
||||
@@ -7413,7 +7412,7 @@ public class Player extends Playable
|
||||
statement.setInt(54, isNewbie() ? 1 : 0);
|
||||
statement.setInt(55, isNoble() ? 1 : 0);
|
||||
statement.setLong(56, 0);
|
||||
statement.setLong(57, Chronos.currentTimeMillis());
|
||||
statement.setLong(57, System.currentTimeMillis());
|
||||
statement.setString(58, StringToHex(Integer.toHexString(getAppearance().getNameColor()).toUpperCase()));
|
||||
statement.setString(59, StringToHex(Integer.toHexString(getAppearance().getTitleColor()).toUpperCase()));
|
||||
statement.setInt(60, isAio() ? 1 : 0);
|
||||
@@ -7492,12 +7491,12 @@ public class Player extends Playable
|
||||
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
|
||||
player.setFirstLog(rset.getInt("first_log"));
|
||||
player._pcBangPoints = rset.getInt("pc_point");
|
||||
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);
|
||||
}
|
||||
@@ -7537,7 +7536,7 @@ public class Player extends Playable
|
||||
|
||||
player.setTitle(rset.getString("title"));
|
||||
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
|
||||
player.setUptime(Chronos.currentTimeMillis());
|
||||
player.setUptime(System.currentTimeMillis());
|
||||
|
||||
curHp = rset.getDouble("curHp");
|
||||
curCp = rset.getDouble("curCp");
|
||||
@@ -8037,7 +8036,7 @@ public class Player extends Playable
|
||||
long totalOnlineTime = _onlineTime;
|
||||
if (_onlineBeginTime > 0)
|
||||
{
|
||||
totalOnlineTime += (Chronos.currentTimeMillis() - _onlineBeginTime) / 1000;
|
||||
totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
|
||||
}
|
||||
statement.setLong(41, _offlineShopStart > 0 ? _onlineTime : totalOnlineTime);
|
||||
statement.setInt(42, getPunishLevel().value());
|
||||
@@ -8132,7 +8131,7 @@ public class Player extends Playable
|
||||
statement = con.prepareStatement(ADD_SKILL_SAVE);
|
||||
int buffIndex = 0;
|
||||
final List<Integer> storedSkills = new ArrayList<>();
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
for (Effect effect : effects)
|
||||
{
|
||||
final int skillId = effect.getSkill().getId();
|
||||
@@ -8558,7 +8557,7 @@ public class Player extends Playable
|
||||
{
|
||||
PreparedStatement statement;
|
||||
ResultSet rset;
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
|
||||
// Restore Type 0 These skill were still in effect on the character upon logout. Some of which were self casted and might still have had a long reuse delay which also is restored.
|
||||
statement = con.prepareStatement(RESTORE_SKILL_SAVE);
|
||||
@@ -9206,14 +9205,14 @@ public class Player extends Playable
|
||||
final Effect effect = getFirstEffect(skill);
|
||||
|
||||
// Like L2OFF toogle skills have little delay
|
||||
if ((_toggleUse != 0) && ((_toggleUse + 400) > Chronos.currentTimeMillis()))
|
||||
if ((_toggleUse != 0) && ((_toggleUse + 400) > System.currentTimeMillis()))
|
||||
{
|
||||
_toggleUse = 0;
|
||||
sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
_toggleUse = Chronos.currentTimeMillis();
|
||||
_toggleUse = System.currentTimeMillis();
|
||||
if (effect != null)
|
||||
{
|
||||
// fake death exception
|
||||
@@ -10307,7 +10306,7 @@ public class Player extends Playable
|
||||
protected LookingForFishTask(int fishWaitTime, int fishGutsCheck, int fishType, boolean isNoob, boolean isUpperGrade)
|
||||
{
|
||||
_fishGutsCheck = fishGutsCheck;
|
||||
_endTaskTime = Chronos.currentTimeMillis() + fishWaitTime + 10000;
|
||||
_endTaskTime = System.currentTimeMillis() + fishWaitTime + 10000;
|
||||
_fishType = fishType;
|
||||
_isNoob = isNoob;
|
||||
_isUpperGrade = isUpperGrade;
|
||||
@@ -10316,7 +10315,7 @@ public class Player extends Playable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (Chronos.currentTimeMillis() >= _endTaskTime)
|
||||
if (System.currentTimeMillis() >= _endTaskTime)
|
||||
{
|
||||
endFishing(false);
|
||||
return;
|
||||
@@ -14031,7 +14030,7 @@ public class Player extends Playable
|
||||
|
||||
public void restoreCustomStatus()
|
||||
{
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if (getVariables().getLong("CustomDonatorEnd", 0) > currentTime)
|
||||
{
|
||||
setDonator(true);
|
||||
@@ -14641,7 +14640,7 @@ public class Player extends Playable
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((_fallingTimestamp != 0) && (Chronos.currentTimeMillis() < _fallingTimestamp))
|
||||
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -14681,7 +14680,7 @@ public class Player extends Playable
|
||||
|
||||
// Prevent falling under ground.
|
||||
sendPacket(new ValidateLocation(this));
|
||||
_fallingTimestamp = Chronos.currentTimeMillis() + FALLING_VALIDATION_DELAY;
|
||||
_fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -15079,7 +15078,7 @@ public class Player extends Playable
|
||||
|
||||
public void addConfirmDlgRequestTime(int requestId, int time)
|
||||
{
|
||||
_confirmDlgRequests.put(requestId, Chronos.currentTimeMillis() + time + 2000);
|
||||
_confirmDlgRequests.put(requestId, System.currentTimeMillis() + time + 2000);
|
||||
}
|
||||
|
||||
public Long getConfirmDlgRequestTime(int requestId)
|
||||
|
@@ -23,7 +23,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanHallTable;
|
||||
import org.l2jmobius.gameserver.data.xml.MapRegionData;
|
||||
@@ -201,7 +200,7 @@ public class Auctioneer extends Folk
|
||||
html.replace("%AGIT_LEASE%", String.valueOf(ClanHallTable.getInstance().getClanHallById(a.getItemId()).getLease()));
|
||||
html.replace("%AGIT_LOCATION%", ClanHallTable.getInstance().getClanHallById(a.getItemId()).getLocation());
|
||||
html.replace("%AGIT_AUCTION_END%", format.format(a.getEndDate()));
|
||||
html.replace("%AGIT_AUCTION_REMAIN%", ((a.getEndDate() - Chronos.currentTimeMillis()) / 3600000) + " hours " + (((a.getEndDate() - Chronos.currentTimeMillis()) / 60000) % 60) + " minutes");
|
||||
html.replace("%AGIT_AUCTION_REMAIN%", ((a.getEndDate() - System.currentTimeMillis()) / 3600000) + " hours " + (((a.getEndDate() - System.currentTimeMillis()) / 60000) % 60) + " minutes");
|
||||
html.replace("%AGIT_AUCTION_MINBID%", String.valueOf(a.getStartingBid()));
|
||||
html.replace("%AGIT_AUCTION_COUNT%", String.valueOf(a.getBidders().size()));
|
||||
html.replace("%AGIT_AUCTION_DESC%", ClanHallTable.getInstance().getClanHallById(a.getItemId()).getDesc());
|
||||
@@ -404,7 +403,7 @@ public class Auctioneer extends Folk
|
||||
html.replace("%AGIT_LEASE%", String.valueOf(ClanHallTable.getInstance().getClanHallById(a.getItemId()).getLease()));
|
||||
html.replace("%AGIT_LOCATION%", ClanHallTable.getInstance().getClanHallById(a.getItemId()).getLocation());
|
||||
html.replace("%AGIT_AUCTION_END%", format.format(a.getEndDate()));
|
||||
html.replace("%AGIT_AUCTION_REMAIN%", ((a.getEndDate() - Chronos.currentTimeMillis()) / 3600000) + " hours " + (((a.getEndDate() - Chronos.currentTimeMillis()) / 60000) % 60) + " minutes");
|
||||
html.replace("%AGIT_AUCTION_REMAIN%", ((a.getEndDate() - System.currentTimeMillis()) / 3600000) + " hours " + (((a.getEndDate() - System.currentTimeMillis()) / 60000) % 60) + " minutes");
|
||||
html.replace("%AGIT_AUCTION_MINBID%", String.valueOf(a.getStartingBid()));
|
||||
html.replace("%AGIT_AUCTION_MYBID%", String.valueOf(a.getBidders().get(player.getClanId()).getBid()));
|
||||
html.replace("%AGIT_AUCTION_DESC%", ClanHallTable.getInstance().getClanHallById(a.getItemId()).getDesc());
|
||||
@@ -435,7 +434,7 @@ public class Auctioneer extends Folk
|
||||
html.replace("%AGIT_LEASE%", String.valueOf(ClanHallTable.getInstance().getClanHallById(a.getItemId()).getLease()));
|
||||
html.replace("%AGIT_LOCATION%", ClanHallTable.getInstance().getClanHallById(a.getItemId()).getLocation());
|
||||
html.replace("%AGIT_AUCTION_END%", format.format(a.getEndDate()));
|
||||
html.replace("%AGIT_AUCTION_REMAIN%", ((a.getEndDate() - Chronos.currentTimeMillis()) / 3600000) + " hours " + (((a.getEndDate() - Chronos.currentTimeMillis()) / 60000) % 60) + " minutes");
|
||||
html.replace("%AGIT_AUCTION_REMAIN%", ((a.getEndDate() - System.currentTimeMillis()) / 3600000) + " hours " + (((a.getEndDate() - System.currentTimeMillis()) / 60000) % 60) + " minutes");
|
||||
html.replace("%AGIT_AUCTION_MINBID%", String.valueOf(a.getStartingBid()));
|
||||
html.replace("%AGIT_AUCTION_BIDCOUNT%", String.valueOf(a.getBidders().size()));
|
||||
html.replace("%AGIT_AUCTION_DESC%", ClanHallTable.getInstance().getClanHallById(a.getItemId()).getDesc());
|
||||
|
@@ -20,7 +20,6 @@ import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.sql.SkillTreeTable;
|
||||
import org.l2jmobius.gameserver.data.xml.PlayerTemplateData;
|
||||
@@ -627,13 +626,13 @@ public class VillageMaster extends Folk
|
||||
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();
|
||||
|
||||
ClanTable.getInstance().scheduleRemoveClan(clan.getClanId());
|
||||
|
@@ -32,7 +32,6 @@ import java.util.regex.PatternSyntaxException;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.communitybbs.BB.Forum;
|
||||
import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
||||
import org.l2jmobius.gameserver.data.SkillTable;
|
||||
@@ -465,7 +464,7 @@ public class Clan
|
||||
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
|
||||
@@ -483,7 +482,7 @@ public class Clan
|
||||
}
|
||||
else
|
||||
{
|
||||
removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderName().equalsIgnoreCase(name) ? Chronos.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
|
||||
removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderName().equalsIgnoreCase(name) ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -808,14 +807,14 @@ public class Clan
|
||||
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);
|
||||
}
|
||||
@@ -1794,7 +1793,7 @@ public class Clan
|
||||
}
|
||||
}
|
||||
|
||||
if (_charPenaltyExpiryTime > Chronos.currentTimeMillis())
|
||||
if (_charPenaltyExpiryTime > System.currentTimeMillis())
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
|
||||
sm.addString(target.getName());
|
||||
@@ -1810,7 +1809,7 @@ public class Clan
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target.getClanJoinExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (target.getClanJoinExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_HE_SHE_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
@@ -1865,7 +1864,7 @@ public class Clan
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -1921,7 +1920,7 @@ public class Clan
|
||||
return false;
|
||||
}
|
||||
|
||||
if (targetClan.getAllyPenaltyExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (targetClan.getAllyPenaltyExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
if (targetClan.getAllyPenaltyType() == PENALTY_TYPE_CLAN_LEAVED)
|
||||
{
|
||||
@@ -2029,13 +2028,13 @@ public class Clan
|
||||
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_10_DAYS_AFTER_DISSOLUTION);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_dissolvingExpiryTime > Chronos.currentTimeMillis())
|
||||
if (_dissolvingExpiryTime > System.currentTimeMillis())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_MAY_NOT_CREATE_AN_ALLIANCE_DURING_THE_TERM_OF_DISSOLUTION_POSTPONEMENT);
|
||||
return;
|
||||
@@ -2104,7 +2103,7 @@ public class Clan
|
||||
|
||||
broadcastToOnlineAllyMembers(new SystemMessage(SystemMessageId.THE_ALLIANCE_HAS_BEEN_DISSOLVED));
|
||||
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
for (Clan clan : ClanTable.getInstance().getClans())
|
||||
{
|
||||
if ((clan.getAllyId() == getAllyId()) && (clan.getClanId() != getClanId()))
|
||||
@@ -2134,7 +2133,7 @@ public class Clan
|
||||
return;
|
||||
}
|
||||
|
||||
if (Chronos.currentTimeMillis() < _dissolvingExpiryTime)
|
||||
if (System.currentTimeMillis() < _dissolvingExpiryTime)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_RAISE_YOUR_CLAN_LEVEL_DURING_THE_TERM_OF_DISPERSION_POSTPONEMENT);
|
||||
return;
|
||||
|
@@ -27,7 +27,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.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.data.ItemTable;
|
||||
import org.l2jmobius.gameserver.enums.ItemLocation;
|
||||
@@ -1052,7 +1051,7 @@ public class Item extends WorldObject
|
||||
getWorldRegion().addVisibleObject(this);
|
||||
}
|
||||
|
||||
setDropTime(Chronos.currentTimeMillis());
|
||||
setDropTime(System.currentTimeMillis());
|
||||
|
||||
// this can synchronize on others instancies, so it's out of synchronized, to avoid deadlocks
|
||||
// Add the Item dropped in the world as a visible object
|
||||
|
@@ -38,7 +38,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.gameserver.data.ItemTable;
|
||||
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
|
||||
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
||||
@@ -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());
|
||||
}
|
||||
@@ -321,7 +320,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.intValue());
|
||||
|
@@ -28,7 +28,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.ClanHallTable;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.xml.DoorData;
|
||||
@@ -183,7 +182,7 @@ public class ClanHall
|
||||
return;
|
||||
}
|
||||
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if (_endDate > currentTime)
|
||||
{
|
||||
ThreadPool.schedule(new FunctionTask(), _endDate - currentTime);
|
||||
@@ -227,7 +226,7 @@ public class ClanHall
|
||||
newfc = false;
|
||||
}
|
||||
|
||||
setEndTime(Chronos.currentTimeMillis() + _rate);
|
||||
setEndTime(System.currentTimeMillis() + _rate);
|
||||
dbSave(newfc);
|
||||
getOwnerClan().getWarehouse().destroyItemByItemId("CH_function_fee", 57, fee, null, null);
|
||||
ThreadPool.schedule(new FunctionTask(), _rate);
|
||||
@@ -487,7 +486,7 @@ public class ClanHall
|
||||
|
||||
_ownerId = clan.getClanId();
|
||||
_isFree = false;
|
||||
_paidUntil = Chronos.currentTimeMillis();
|
||||
_paidUntil = System.currentTimeMillis();
|
||||
initialyzeTask(true);
|
||||
|
||||
// Annonce to Online member new ClanHall
|
||||
@@ -748,20 +747,20 @@ public class ClanHall
|
||||
*/
|
||||
private void initialyzeTask(boolean forced)
|
||||
{
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if (_paidUntil > currentTime)
|
||||
{
|
||||
ThreadPool.schedule(new FeeTask(), _paidUntil - currentTime);
|
||||
}
|
||||
else if (!_paid && !forced)
|
||||
{
|
||||
if ((Chronos.currentTimeMillis() + (1000 * 60 * 60 * 24)) <= (_paidUntil + _chRate))
|
||||
if ((System.currentTimeMillis() + (1000 * 60 * 60 * 24)) <= (_paidUntil + _chRate))
|
||||
{
|
||||
ThreadPool.schedule(new FeeTask(), Chronos.currentTimeMillis() + (1000 * 60 * 60 * 24));
|
||||
ThreadPool.schedule(new FeeTask(), System.currentTimeMillis() + (1000 * 60 * 60 * 24));
|
||||
}
|
||||
else
|
||||
{
|
||||
ThreadPool.schedule(new FeeTask(), (_paidUntil + _chRate) - Chronos.currentTimeMillis());
|
||||
ThreadPool.schedule(new FeeTask(), (_paidUntil + _chRate) - System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -790,25 +789,25 @@ public class ClanHall
|
||||
{
|
||||
if (_paidUntil != 0)
|
||||
{
|
||||
while (_paidUntil < Chronos.currentTimeMillis())
|
||||
while (_paidUntil < System.currentTimeMillis())
|
||||
{
|
||||
_paidUntil += _chRate;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_paidUntil = Chronos.currentTimeMillis() + _chRate;
|
||||
_paidUntil = System.currentTimeMillis() + _chRate;
|
||||
}
|
||||
|
||||
ClanTable.getInstance().getClan(getOwnerId()).getWarehouse().destroyItemByItemId("CH_rental_fee", 57, getLease(), null, null);
|
||||
ThreadPool.schedule(new FeeTask(), _paidUntil - Chronos.currentTimeMillis());
|
||||
ThreadPool.schedule(new FeeTask(), _paidUntil - System.currentTimeMillis());
|
||||
_paid = true;
|
||||
updateDb();
|
||||
}
|
||||
else
|
||||
{
|
||||
_paid = false;
|
||||
if (Chronos.currentTimeMillis() > (_paidUntil + _chRate))
|
||||
if (System.currentTimeMillis() > (_paidUntil + _chRate))
|
||||
{
|
||||
if (ClanHallTable.getInstance().loaded())
|
||||
{
|
||||
@@ -828,13 +827,13 @@ public class ClanHall
|
||||
sm.addNumber(getLease());
|
||||
clan.broadcastToOnlineMembers(sm);
|
||||
|
||||
if ((Chronos.currentTimeMillis() + (1000 * 60 * 60 * 24)) <= (_paidUntil + _chRate))
|
||||
if ((System.currentTimeMillis() + (1000 * 60 * 60 * 24)) <= (_paidUntil + _chRate))
|
||||
{
|
||||
ThreadPool.schedule(new FeeTask(), Chronos.currentTimeMillis() + (1000 * 60 * 60 * 24));
|
||||
ThreadPool.schedule(new FeeTask(), System.currentTimeMillis() + (1000 * 60 * 60 * 24));
|
||||
}
|
||||
else
|
||||
{
|
||||
ThreadPool.schedule(new FeeTask(), (_paidUntil + _chRate) - Chronos.currentTimeMillis());
|
||||
ThreadPool.schedule(new FeeTask(), (_paidUntil + _chRate) - System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -26,7 +26,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.ClanHallTable;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.AuctionManager;
|
||||
@@ -169,7 +168,7 @@ public class ClanHallAuction
|
||||
public ClanHallAuction(int itemId, Clan clan, long delay, int bid, String name)
|
||||
{
|
||||
_id = itemId;
|
||||
_endDate = Chronos.currentTimeMillis() + delay;
|
||||
_endDate = System.currentTimeMillis() + delay;
|
||||
_itemId = itemId;
|
||||
_itemName = name;
|
||||
_itemType = "ClanHall";
|
||||
@@ -255,7 +254,7 @@ public class ClanHallAuction
|
||||
*/
|
||||
private void startAutoTask()
|
||||
{
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
long taskDelay = 0;
|
||||
if (_endDate <= currentTime)
|
||||
{
|
||||
@@ -368,7 +367,7 @@ public class ClanHallAuction
|
||||
statement.setInt(1, bidder.getClanId());
|
||||
statement.setString(2, bidder.getClan().getLeaderName());
|
||||
statement.setInt(3, bid);
|
||||
statement.setLong(4, Chronos.currentTimeMillis());
|
||||
statement.setLong(4, System.currentTimeMillis());
|
||||
statement.setInt(5, _id);
|
||||
statement.setInt(6, bidder.getClanId());
|
||||
statement.execute();
|
||||
@@ -383,7 +382,7 @@ public class ClanHallAuction
|
||||
statement.setString(4, bidder.getName());
|
||||
statement.setInt(5, bid);
|
||||
statement.setString(6, bidder.getClan().getName());
|
||||
statement.setLong(7, Chronos.currentTimeMillis());
|
||||
statement.setLong(7, System.currentTimeMillis());
|
||||
statement.execute();
|
||||
statement.close();
|
||||
|
||||
|
@@ -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.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.handler.AutoChatHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
@@ -483,7 +482,7 @@ public class SevenSigns
|
||||
*/
|
||||
public long getMilliToPeriodChange()
|
||||
{
|
||||
final long currTimeMillis = Chronos.currentTimeMillis();
|
||||
final long currTimeMillis = System.currentTimeMillis();
|
||||
final long changeTimeMillis = _calendar.getTimeInMillis();
|
||||
return changeTimeMillis - currTimeMillis;
|
||||
}
|
||||
|
@@ -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.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
@@ -3640,7 +3639,7 @@ public class SevenSignsFestival implements SpawnListener
|
||||
*/
|
||||
public void setNextCycleStart()
|
||||
{
|
||||
_nextFestivalCycleStart = Chronos.currentTimeMillis() + Config.ALT_FESTIVAL_CYCLE_LENGTH;
|
||||
_nextFestivalCycleStart = System.currentTimeMillis() + Config.ALT_FESTIVAL_CYCLE_LENGTH;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3649,7 +3648,7 @@ public class SevenSignsFestival implements SpawnListener
|
||||
*/
|
||||
public void setNextFestivalStart(long milliFromNow)
|
||||
{
|
||||
_nextFestivalStart = Chronos.currentTimeMillis() + milliFromNow;
|
||||
_nextFestivalStart = System.currentTimeMillis() + milliFromNow;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3662,7 +3661,7 @@ public class SevenSignsFestival implements SpawnListener
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return Math.round((_nextFestivalCycleStart - Chronos.currentTimeMillis()) / 60000);
|
||||
return Math.round((_nextFestivalCycleStart - System.currentTimeMillis()) / 60000);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3675,7 +3674,7 @@ public class SevenSignsFestival implements SpawnListener
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return Math.round((_nextFestivalStart - Chronos.currentTimeMillis()) / 60000) + 1;
|
||||
return Math.round((_nextFestivalStart - System.currentTimeMillis()) / 60000) + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4004,7 +4003,7 @@ public class SevenSignsFestival implements SpawnListener
|
||||
}
|
||||
|
||||
// Update the highest scores and party list.
|
||||
currFestData.set("date", String.valueOf(Chronos.currentTimeMillis()));
|
||||
currFestData.set("date", String.valueOf(System.currentTimeMillis()));
|
||||
currFestData.set("score", offeringScore);
|
||||
currFestData.set("members", Util.implodeString(partyMembers, ","));
|
||||
|
||||
|
@@ -23,7 +23,6 @@ import java.util.Calendar;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
|
||||
/**
|
||||
* @author MHard
|
||||
@@ -61,9 +60,9 @@ public abstract class ClanHallSiege
|
||||
public void setNewSiegeDate(long siegeDate, int clanHallId, int hour)
|
||||
{
|
||||
final Calendar tmpDate = Calendar.getInstance();
|
||||
if (siegeDate <= Chronos.currentTimeMillis())
|
||||
if (siegeDate <= System.currentTimeMillis())
|
||||
{
|
||||
tmpDate.setTimeInMillis(Chronos.currentTimeMillis());
|
||||
tmpDate.setTimeInMillis(System.currentTimeMillis());
|
||||
tmpDate.add(Calendar.DAY_OF_MONTH, 3);
|
||||
tmpDate.set(Calendar.DAY_OF_WEEK, 6);
|
||||
tmpDate.set(Calendar.HOUR_OF_DAY, hour);
|
||||
|
@@ -30,7 +30,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.data.sql.NpcTable;
|
||||
import org.l2jmobius.gameserver.enums.SiegeTeleportWhoType;
|
||||
@@ -305,12 +304,12 @@ public class Siege
|
||||
player.sendPacket(sound);
|
||||
}
|
||||
|
||||
LOGGER.info("[SIEGE] The siege of " + getCastle().getName() + " has finished! " + fmt.format(new Date(Chronos.currentTimeMillis())));
|
||||
LOGGER.info("[SIEGE] The siege of " + getCastle().getName() + " has finished! " + fmt.format(new Date(System.currentTimeMillis())));
|
||||
if (getCastle().getOwnerId() <= 0)
|
||||
{
|
||||
announceToPlayer("The siege of " + getCastle().getName() + " has ended in a draw.", false);
|
||||
|
||||
LOGGER.info("[SIEGE] The siege of " + getCastle().getName() + " has ended in a draw. " + fmt.format(new Date(Chronos.currentTimeMillis())));
|
||||
LOGGER.info("[SIEGE] The siege of " + getCastle().getName() + " has ended in a draw. " + fmt.format(new Date(System.currentTimeMillis())));
|
||||
}
|
||||
|
||||
// Removes all flags. Note: Remove flag before teleporting players
|
||||
@@ -586,7 +585,7 @@ public class Siege
|
||||
player.sendPacket(sound);
|
||||
}
|
||||
|
||||
LOGGER.info("[SIEGE] The siege of " + getCastle().getName() + " has started! " + fmt.format(new Date(Chronos.currentTimeMillis())));
|
||||
LOGGER.info("[SIEGE] The siege of " + getCastle().getName() + " has started! " + fmt.format(new Date(System.currentTimeMillis())));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -25,7 +25,6 @@ import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanHallTable;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
||||
@@ -521,9 +520,9 @@ public class BanditStrongholdSiege extends ClanHallSiege
|
||||
}
|
||||
final Calendar siegeStart = Calendar.getInstance();
|
||||
siegeStart.setTimeInMillis(getSiegeDate().getTimeInMillis());
|
||||
final long registerTimeRemaining = siegeStart.getTimeInMillis() - Chronos.currentTimeMillis();
|
||||
final long registerTimeRemaining = siegeStart.getTimeInMillis() - System.currentTimeMillis();
|
||||
siegeStart.add(Calendar.MINUTE, 60); // HOUR
|
||||
final long siegeTimeRemaining = siegeStart.getTimeInMillis() - Chronos.currentTimeMillis();
|
||||
final long siegeTimeRemaining = siegeStart.getTimeInMillis() - System.currentTimeMillis();
|
||||
long remaining = registerTimeRemaining;
|
||||
if ((registerTimeRemaining <= 0) && !_registrationPeriod)
|
||||
{
|
||||
@@ -590,7 +589,7 @@ public class BanditStrongholdSiege extends ClanHallSiege
|
||||
cancel();
|
||||
return;
|
||||
}
|
||||
final long timeRemaining = _siegeEndDate.getTimeInMillis() - Chronos.currentTimeMillis();
|
||||
final long timeRemaining = _siegeEndDate.getTimeInMillis() - System.currentTimeMillis();
|
||||
if (timeRemaining <= 0)
|
||||
{
|
||||
endSiege(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.data.sql.AnnouncementsTable;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanHallTable;
|
||||
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
||||
@@ -131,7 +130,7 @@ public class DevastatedCastle
|
||||
final RunMessengerSpawn rms = new RunMessengerSpawn();
|
||||
ThreadPool.schedule(rms, milliToSiege);
|
||||
|
||||
final long total_millis = Chronos.currentTimeMillis() + milliToSiege;
|
||||
final long total_millis = System.currentTimeMillis() + milliToSiege;
|
||||
final GregorianCalendar cal = (GregorianCalendar) Calendar.getInstance();
|
||||
cal.setTimeInMillis(total_millis);
|
||||
final String next_ch_siege_date = new SimpleDateFormat("yyyy/MM/dd HH:mm").format(cal.getTimeInMillis());
|
||||
@@ -175,7 +174,7 @@ public class DevastatedCastle
|
||||
|
||||
private long getMilliToSiege()
|
||||
{
|
||||
final long currTimeMillis = Chronos.currentTimeMillis();
|
||||
final long currTimeMillis = System.currentTimeMillis();
|
||||
final long siegeTimeMillis = _siegetime.getTimeInMillis();
|
||||
return siegeTimeMillis - currTimeMillis;
|
||||
}
|
||||
@@ -844,7 +843,7 @@ public class DevastatedCastle
|
||||
{
|
||||
PreparedStatement statement;
|
||||
statement = con.prepareStatement("UPDATE clanhall SET paidUntil=?, paid=? WHERE id=?");
|
||||
statement.setLong(1, Chronos.currentTimeMillis() + 59760000);
|
||||
statement.setLong(1, System.currentTimeMillis() + 59760000);
|
||||
statement.setInt(2, 1);
|
||||
statement.setInt(3, 34);
|
||||
statement.execute();
|
||||
|
@@ -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.AnnouncementsTable;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanHallTable;
|
||||
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
||||
@@ -116,7 +115,7 @@ public class FortressOfResistance
|
||||
final RunMessengerSpawn rms = new RunMessengerSpawn();
|
||||
ThreadPool.schedule(rms, milliToCapture);
|
||||
|
||||
final long total_millis = Chronos.currentTimeMillis() + milliToCapture;
|
||||
final long total_millis = System.currentTimeMillis() + milliToCapture;
|
||||
final GregorianCalendar cal = (GregorianCalendar) Calendar.getInstance();
|
||||
cal.setTimeInMillis(total_millis);
|
||||
final String next_ch_siege_date = new SimpleDateFormat("yyyy/MM/dd HH:mm").format(cal.getTimeInMillis());
|
||||
@@ -160,7 +159,7 @@ public class FortressOfResistance
|
||||
|
||||
private long getMilliToCapture()
|
||||
{
|
||||
final long currTimeMillis = Chronos.currentTimeMillis();
|
||||
final long currTimeMillis = System.currentTimeMillis();
|
||||
final long captureTimeMillis = _capturetime.getTimeInMillis();
|
||||
return captureTimeMillis - currTimeMillis;
|
||||
}
|
||||
@@ -338,7 +337,7 @@ public class FortressOfResistance
|
||||
{
|
||||
PreparedStatement statement;
|
||||
statement = con.prepareStatement("UPDATE clanhall SET paidUntil=?, paid=? WHERE id=?");
|
||||
statement.setLong(1, Chronos.currentTimeMillis() + 59760000);
|
||||
statement.setLong(1, System.currentTimeMillis() + 59760000);
|
||||
statement.setInt(2, 1);
|
||||
statement.setInt(3, 21);
|
||||
statement.execute();
|
||||
|
@@ -25,7 +25,6 @@ import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanHallTable;
|
||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
||||
@@ -510,9 +509,9 @@ public class WildBeastFarmSiege extends ClanHallSiege
|
||||
}
|
||||
final Calendar siegeStart = Calendar.getInstance();
|
||||
siegeStart.setTimeInMillis(getSiegeDate().getTimeInMillis());
|
||||
final long registerTimeRemaining = siegeStart.getTimeInMillis() - Chronos.currentTimeMillis();
|
||||
final long registerTimeRemaining = siegeStart.getTimeInMillis() - System.currentTimeMillis();
|
||||
siegeStart.add(Calendar.HOUR, 1);
|
||||
final long siegeTimeRemaining = siegeStart.getTimeInMillis() - Chronos.currentTimeMillis();
|
||||
final long siegeTimeRemaining = siegeStart.getTimeInMillis() - System.currentTimeMillis();
|
||||
long remaining = registerTimeRemaining;
|
||||
if ((registerTimeRemaining <= 0) && !_registrationPeriod)
|
||||
{
|
||||
@@ -579,7 +578,7 @@ public class WildBeastFarmSiege extends ClanHallSiege
|
||||
cancel();
|
||||
return;
|
||||
}
|
||||
final long timeRemaining = _siegeEndDate.getTimeInMillis() - Chronos.currentTimeMillis();
|
||||
final long timeRemaining = _siegeEndDate.getTimeInMillis() - System.currentTimeMillis();
|
||||
if (timeRemaining <= 0)
|
||||
{
|
||||
endSiege(true);
|
||||
|
@@ -22,7 +22,6 @@ import java.util.List;
|
||||
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.sql.TerritoryTable;
|
||||
import org.l2jmobius.gameserver.data.xml.WalkerRouteData;
|
||||
@@ -320,7 +319,7 @@ public class Spawn
|
||||
_scheduledCount++;
|
||||
|
||||
// Schedule the next respawn.
|
||||
RespawnTaskManager.getInstance().add(oldNpc, Chronos.currentTimeMillis() + _respawnDelay);
|
||||
RespawnTaskManager.getInstance().add(oldNpc, System.currentTimeMillis() + _respawnDelay);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.GameServer;
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -138,7 +137,7 @@ public class BossZone extends ZoneType
|
||||
if (expirationTime == null) // legal null expirationTime entries
|
||||
{
|
||||
final long serverStartTime = GameServer.dateTimeServerStarted.getTimeInMillis();
|
||||
if (serverStartTime > (Chronos.currentTimeMillis() - _timeInvade))
|
||||
if (serverStartTime > (System.currentTimeMillis() - _timeInvade))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -148,7 +147,7 @@ public class BossZone extends ZoneType
|
||||
// legal non-null logoutTime entries
|
||||
_playerAllowedReEntryTimes.remove(creature.getObjectId());
|
||||
|
||||
if (expirationTime.longValue() > Chronos.currentTimeMillis())
|
||||
if (expirationTime.longValue() > System.currentTimeMillis())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -205,7 +204,7 @@ public class BossZone extends ZoneType
|
||||
if (!player.isOnline() && _playersAllowed.contains(creature.getObjectId()))
|
||||
{
|
||||
// mark the time that the player left the zone
|
||||
_playerAllowedReEntryTimes.put(creature.getObjectId(), Chronos.currentTimeMillis() + _timeInvade);
|
||||
_playerAllowedReEntryTimes.put(creature.getObjectId(), System.currentTimeMillis() + _timeInvade);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -304,7 +303,7 @@ public class BossZone extends ZoneType
|
||||
{
|
||||
_playersAllowed.add(player.getObjectId());
|
||||
}
|
||||
_playerAllowedReEntryTimes.put(player.getObjectId(), Chronos.currentTimeMillis() + (durationInSec * 1000));
|
||||
_playerAllowedReEntryTimes.put(player.getObjectId(), System.currentTimeMillis() + (durationInSec * 1000));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,6 @@ import org.l2jmobius.commons.network.ChannelInboundHandler;
|
||||
import org.l2jmobius.commons.network.ICrypt;
|
||||
import org.l2jmobius.commons.network.IIncomingPacket;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.LoginServerThread;
|
||||
import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
|
||||
import org.l2jmobius.gameserver.data.SkillTable;
|
||||
@@ -319,7 +318,7 @@ public class GameClient extends ChannelInboundHandler<GameClient>
|
||||
else
|
||||
{
|
||||
statement = con.prepareStatement("UPDATE characters SET deletetime=? WHERE charId=?");
|
||||
statement.setLong(1, Chronos.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
statement.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
statement.setInt(2, objectId);
|
||||
statement.execute();
|
||||
statement.close();
|
||||
@@ -681,7 +680,7 @@ public class GameClient extends ChannelInboundHandler<GameClient>
|
||||
|
||||
if (player.getOfflineStartTime() == 0)
|
||||
{
|
||||
player.setOfflineStartTime(Chronos.currentTimeMillis());
|
||||
player.setOfflineStartTime(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
OfflineTraderTable.getInstance().storeOffliner(player);
|
||||
|
@@ -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;
|
||||
@@ -88,7 +87,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;
|
||||
@@ -66,7 +65,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);
|
||||
|
@@ -50,7 +50,7 @@ public class DlgAnswer implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// final Long answerTime = player.getConfirmDlgRequestTime(_requesterId);
|
||||
// if ((_answer == 1) && (answerTime != null) && (Chronos.currentTimeMillis() > answerTime))
|
||||
// if ((_answer == 1) && (answerTime != null) && (System.currentTimeMillis() > answerTime))
|
||||
// {
|
||||
// _answer = 0;
|
||||
// }
|
||||
|
@@ -26,7 +26,6 @@ import java.util.regex.PatternSyntaxException;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.communitybbs.Manager.MailBBSManager;
|
||||
import org.l2jmobius.gameserver.data.SkillTable;
|
||||
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
|
||||
@@ -348,7 +347,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
DimensionalRiftManager.getInstance().teleportToWaitingRoom(player);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -609,7 +608,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
|
||||
if (Config.SERVER_TIME_ON_START)
|
||||
{
|
||||
player.sendMessage("SVR time is " + fmt.format(new Date(Chronos.currentTimeMillis())));
|
||||
player.sendMessage("SVR time is " + fmt.format(new Date(System.currentTimeMillis())));
|
||||
}
|
||||
|
||||
// EnterWorld has finished.
|
||||
|
@@ -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.SkillTable;
|
||||
import org.l2jmobius.gameserver.model.Party;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -132,7 +131,7 @@ public class Logout implements IClientIncomingPacket
|
||||
|
||||
if (player.getOfflineStartTime() == 0)
|
||||
{
|
||||
player.setOfflineStartTime(Chronos.currentTimeMillis());
|
||||
player.setOfflineStartTime(System.currentTimeMillis());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -144,7 +143,7 @@ public class Logout implements IClientIncomingPacket
|
||||
|
||||
if (player.getOfflineStartTime() == 0)
|
||||
{
|
||||
player.setOfflineStartTime(Chronos.currentTimeMillis());
|
||||
player.setOfflineStartTime(System.currentTimeMillis());
|
||||
}
|
||||
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.sql.CrestTable;
|
||||
import org.l2jmobius.gameserver.enums.CrestType;
|
||||
import org.l2jmobius.gameserver.model.Crest;
|
||||
@@ -69,7 +68,7 @@ public class RequestExSetPledgeCrestLarge implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.DURING_THE_GRACE_PERIOD_FOR_DISSOLVING_A_CLAN_THE_REGISTRATION_OR_DELETION_OF_A_CLAN_S_CREST_IS_NOT_ALLOWED);
|
||||
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.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -68,7 +67,7 @@ public class RequestJoinSiege implements IClientIncomingPacket
|
||||
|
||||
if (_isJoining == 1)
|
||||
{
|
||||
if (Chronos.currentTimeMillis() < player.getClan().getDissolvingExpiryTime())
|
||||
if (System.currentTimeMillis() < player.getClan().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;
|
||||
@@ -100,7 +99,7 @@ public class RequestJoinSiege implements IClientIncomingPacket
|
||||
|
||||
if (_isJoining == 1)
|
||||
{
|
||||
if (Chronos.currentTimeMillis() < player.getClan().getDissolvingExpiryTime())
|
||||
if (System.currentTimeMillis() < player.getClan().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.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||
@@ -81,8 +80,8 @@ public class RequestOustPledgeMember implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// this also updates the database
|
||||
clan.removeClanMember(_target, Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // Like L2OFF also player takes the penality
|
||||
clan.setCharPenaltyExpiryTime(Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
clan.removeClanMember(_target, System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // Like L2OFF also player takes the penality
|
||||
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);
|
||||
|
@@ -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;
|
||||
@@ -74,7 +73,7 @@ public class RequestSetPledgeCrest implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis())
|
||||
if (clan.getDissolvingExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.DURING_THE_GRACE_PERIOD_FOR_DISSOLVING_A_CLAN_THE_REGISTRATION_OR_DELETION_OF_A_CLAN_S_CREST_IS_NOT_ALLOWED);
|
||||
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.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
@@ -62,7 +61,7 @@ public class RequestWithdrawalPledge implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
clan.removeClanMember(player.getName(), Chronos.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
|
||||
clan.removeClanMember(player.getName(), 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());
|
||||
|
@@ -24,7 +24,6 @@ import java.util.List;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.CharSelectInfoPackage;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
@@ -159,7 +158,7 @@ public class CharSelectInfo implements IClientOutgoingPacket
|
||||
int deletedays = 0;
|
||||
if (deleteTime > 0)
|
||||
{
|
||||
deletedays = (int) ((deleteTime - Chronos.currentTimeMillis()) / 1000);
|
||||
deletedays = (int) ((deleteTime - System.currentTimeMillis()) / 1000);
|
||||
}
|
||||
else if (accesslevels < 0)
|
||||
{
|
||||
@@ -236,7 +235,7 @@ public class CharSelectInfo implements IClientOutgoingPacket
|
||||
final int objectId = chardata.getInt("charId");
|
||||
// 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 Player cha = Player.load(objectId);
|
||||
final Clan clan = cha.getClan();
|
||||
|
@@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.serverpackets;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
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;
|
||||
@@ -54,7 +53,7 @@ public class GMViewPledgeInfo implements IClientOutgoingPacket
|
||||
packet.writeD(_clan.getHideoutId());
|
||||
packet.writeD(0);
|
||||
packet.writeD(_player.getLevel());
|
||||
packet.writeD(_clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis() ? 3 : 0);
|
||||
packet.writeD(_clan.getDissolvingExpiryTime() > System.currentTimeMillis() ? 3 : 0);
|
||||
packet.writeD(0);
|
||||
packet.writeD(_clan.getAllyId()); // c2
|
||||
packet.writeS(_clan.getAllyName()); // c2
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.clan.ClanMember;
|
||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
@@ -49,7 +48,7 @@ public class PledgeReceiveMemberInfo implements IClientOutgoingPacket
|
||||
packet.writeD(_member.getClan().getHideoutId());
|
||||
packet.writeD(0);
|
||||
packet.writeD(_player.getLevel()); // ??
|
||||
packet.writeD(_member.getClan().getDissolvingExpiryTime() > Chronos.currentTimeMillis() ? 3 : 0);
|
||||
packet.writeD(_member.getClan().getDissolvingExpiryTime() > System.currentTimeMillis() ? 3 : 0);
|
||||
packet.writeD(0);
|
||||
packet.writeD(_member.getClan().getAllyId());
|
||||
packet.writeS(_member.getClan().getAllyName());
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
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;
|
||||
@@ -47,7 +46,7 @@ public class PledgeShowMemberListAll implements IClientOutgoingPacket
|
||||
packet.writeD(_clan.getHideoutId());
|
||||
packet.writeD(0);
|
||||
packet.writeD(_player.getLevel()); // ??
|
||||
packet.writeD(_clan.getDissolvingExpiryTime() > Chronos.currentTimeMillis() ? 3 : 0);
|
||||
packet.writeD(_clan.getDissolvingExpiryTime() > System.currentTimeMillis() ? 3 : 0);
|
||||
packet.writeD(0);
|
||||
packet.writeD(_clan.getAllyId());
|
||||
packet.writeS(_clan.getAllyName());
|
||||
|
@@ -20,7 +20,6 @@ import java.nio.file.Path;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
|
||||
/**
|
||||
* Abstract class for classes that are meant to be implemented by scripts.<br>
|
||||
@@ -37,7 +36,7 @@ public abstract class ManagedScript
|
||||
public ManagedScript()
|
||||
{
|
||||
_scriptFile = getScriptPath();
|
||||
setLastLoadTime(Chronos.currentTimeMillis());
|
||||
setLastLoadTime(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public abstract Path getScriptPath();
|
||||
|
@@ -24,7 +24,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.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.Cubic;
|
||||
@@ -57,7 +56,7 @@ public class AttackStanceTaskManager implements Runnable
|
||||
}
|
||||
_working = true;
|
||||
|
||||
final long current = Chronos.currentTimeMillis();
|
||||
final long current = System.currentTimeMillis();
|
||||
try
|
||||
{
|
||||
final Iterator<Entry<Creature, Long>> iterator = _attackStanceTasks.entrySet().iterator();
|
||||
@@ -112,7 +111,7 @@ public class AttackStanceTaskManager implements Runnable
|
||||
}
|
||||
}
|
||||
}
|
||||
_attackStanceTasks.put(creature, Chronos.currentTimeMillis());
|
||||
_attackStanceTasks.put(creature, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -23,7 +23,6 @@ import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.instancemanager.TradeManager;
|
||||
|
||||
/**
|
||||
@@ -53,7 +52,7 @@ public class BuyListTaskManager
|
||||
}
|
||||
_workingTimes = true;
|
||||
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
for (Entry<Integer, Long> entry : REFRESH_TIME.entrySet())
|
||||
{
|
||||
if (currentTime > entry.getValue().longValue())
|
||||
@@ -113,7 +112,7 @@ public class BuyListTaskManager
|
||||
PENDING_UPDATES.add(time);
|
||||
}
|
||||
}
|
||||
REFRESH_TIME.put(time, Chronos.currentTimeMillis() + (timeValue * 60 * 60 * 1000L));
|
||||
REFRESH_TIME.put(time, System.currentTimeMillis() + (timeValue * 60 * 60 * 1000L));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -23,7 +23,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.RaidBoss;
|
||||
|
||||
@@ -44,7 +43,7 @@ public class DecayTaskManager implements Runnable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
int delay;
|
||||
try
|
||||
{
|
||||
@@ -78,12 +77,12 @@ public class DecayTaskManager implements Runnable
|
||||
|
||||
public void addDecayTask(Creature actor)
|
||||
{
|
||||
_decayTasks.put(actor, Chronos.currentTimeMillis());
|
||||
_decayTasks.put(actor, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void addDecayTask(Creature actor, int interval)
|
||||
{
|
||||
_decayTasks.put(actor, Chronos.currentTimeMillis() + interval);
|
||||
_decayTasks.put(actor, System.currentTimeMillis() + interval);
|
||||
}
|
||||
|
||||
public void cancelDecayTask(Creature actor)
|
||||
@@ -104,7 +103,7 @@ public class DecayTaskManager implements Runnable
|
||||
ret += "Tasks count: " + _decayTasks.size() + "\r\n";
|
||||
ret += "Tasks dump:\r\n";
|
||||
|
||||
final Long current = Chronos.currentTimeMillis();
|
||||
final Long current = System.currentTimeMillis();
|
||||
for (Creature actor : _decayTasks.keySet())
|
||||
{
|
||||
ret += "Class/Name: " + actor.getClass().getSimpleName() + "/" + actor.getName() + " decay timer: " + (current - _decayTasks.get(actor)) + "\r\n";
|
||||
|
@@ -26,7 +26,6 @@ import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.instancemanager.DayNightSpawnManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -53,7 +52,7 @@ public class GameTimeTaskManager
|
||||
|
||||
protected GameTimeTaskManager()
|
||||
{
|
||||
_gameStartTime = Chronos.currentTimeMillis() - 3600000; // offset so that the server starts a day begin
|
||||
_gameStartTime = System.currentTimeMillis() - 3600000; // offset so that the server starts a day begin
|
||||
_gameTicks = 3600000 / MILLIS_IN_TICK; // offset so that the server starts a day begin
|
||||
|
||||
_timer = new TimerThread();
|
||||
@@ -162,7 +161,7 @@ public class GameTimeTaskManager
|
||||
for (;;)
|
||||
{
|
||||
final int _oldTicks = _gameTicks; // save old ticks value to avoid moving objects 2x in same tick
|
||||
long runtime = Chronos.currentTimeMillis() - _gameStartTime; // from server boot to now
|
||||
long runtime = System.currentTimeMillis() - _gameStartTime; // from server boot to now
|
||||
|
||||
_gameTicks = (int) (runtime / MILLIS_IN_TICK); // new ticks value (ticks now)
|
||||
|
||||
@@ -174,7 +173,7 @@ public class GameTimeTaskManager
|
||||
// (will happen very rarely but it will happen ... on garbage collection definitely)
|
||||
}
|
||||
|
||||
runtime = Chronos.currentTimeMillis() - _gameStartTime - runtime;
|
||||
runtime = System.currentTimeMillis() - _gameStartTime - runtime;
|
||||
|
||||
// calculate sleep time... time needed to next tick minus time it takes to call moveObjects()
|
||||
final int sleepTime = (1 + MILLIS_IN_TICK) - ((int) runtime % MILLIS_IN_TICK);
|
||||
|
@@ -21,7 +21,6 @@ import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
|
||||
@@ -48,7 +47,7 @@ public class ItemManaTaskManager implements Runnable
|
||||
}
|
||||
_working = true;
|
||||
|
||||
final long currentTime = Chronos.currentTimeMillis();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
for (Entry<Item, Long> entry : ITEMS.entrySet())
|
||||
{
|
||||
if (currentTime > entry.getValue().longValue())
|
||||
@@ -73,7 +72,7 @@ public class ItemManaTaskManager implements Runnable
|
||||
{
|
||||
if (!ITEMS.containsKey(item))
|
||||
{
|
||||
ITEMS.put(item, Chronos.currentTimeMillis() + MANA_CONSUMPTION_RATE);
|
||||
ITEMS.put(item, System.currentTimeMillis() + MANA_CONSUMPTION_RATE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,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.enums.ItemLocation;
|
||||
import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
@@ -47,7 +46,7 @@ public class ItemsAutoDestroyTaskManager implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
final long curtime = Chronos.currentTimeMillis();
|
||||
final long curtime = System.currentTimeMillis();
|
||||
for (Item item : _items)
|
||||
{
|
||||
if ((item == null) || (item.getDropTime() == 0) || (item.getItemLocation() != ItemLocation.VOID))
|
||||
@@ -70,7 +69,7 @@ public class ItemsAutoDestroyTaskManager implements Runnable
|
||||
|
||||
public void addItem(Item item)
|
||||
{
|
||||
item.setDropTime(Chronos.currentTimeMillis());
|
||||
item.setDropTime(System.currentTimeMillis());
|
||||
_items.add(item);
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
@@ -47,7 +46,7 @@ public class PlayerAutoSaveTaskManager implements Runnable
|
||||
}
|
||||
_working = true;
|
||||
|
||||
final long time = Chronos.currentTimeMillis();
|
||||
final long time = System.currentTimeMillis();
|
||||
SEARCH: for (Entry<Player, Long> entry : PLAYER_TIMES.entrySet())
|
||||
{
|
||||
if (time > entry.getValue().longValue())
|
||||
@@ -67,7 +66,7 @@ public class PlayerAutoSaveTaskManager implements Runnable
|
||||
|
||||
public void add(Player player)
|
||||
{
|
||||
PLAYER_TIMES.put(player, Chronos.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
|
||||
PLAYER_TIMES.put(player, System.currentTimeMillis() + Config.CHAR_DATA_STORE_INTERVAL);
|
||||
}
|
||||
|
||||
public void remove(Player player)
|
||||
|
@@ -20,7 +20,6 @@ import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
|
||||
/**
|
||||
@@ -47,7 +46,7 @@ public class PvpFlagTaskManager implements Runnable
|
||||
|
||||
if (!PLAYERS.isEmpty())
|
||||
{
|
||||
final long time = Chronos.currentTimeMillis();
|
||||
final long time = System.currentTimeMillis();
|
||||
for (Player player : PLAYERS)
|
||||
{
|
||||
if (time > player.getPvpFlagLasts())
|
||||
|
@@ -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.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
|
||||
@@ -48,7 +47,7 @@ public class RandomAnimationTaskManager implements Runnable
|
||||
}
|
||||
_working = true;
|
||||
|
||||
final long time = Chronos.currentTimeMillis();
|
||||
final long time = System.currentTimeMillis();
|
||||
for (Entry<Npc, Long> entry : PENDING_ANIMATIONS.entrySet())
|
||||
{
|
||||
if (time > entry.getValue().longValue())
|
||||
@@ -69,7 +68,7 @@ public class RandomAnimationTaskManager implements Runnable
|
||||
{
|
||||
if (npc.isRandomAnimationEnabled())
|
||||
{
|
||||
PENDING_ANIMATIONS.putIfAbsent(npc, Chronos.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||
PENDING_ANIMATIONS.putIfAbsent(npc, System.currentTimeMillis() + (Rnd.get((npc.isAttackable() ? Config.MIN_MONSTER_ANIMATION : Config.MIN_NPC_ANIMATION), (npc.isAttackable() ? Config.MAX_MONSTER_ANIMATION : Config.MAX_NPC_ANIMATION)) * 1000));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,6 @@ import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.spawn.Spawn;
|
||||
|
||||
@@ -47,7 +46,7 @@ public class RespawnTaskManager implements Runnable
|
||||
}
|
||||
_working = true;
|
||||
|
||||
final long time = Chronos.currentTimeMillis();
|
||||
final long time = System.currentTimeMillis();
|
||||
for (Entry<Npc, Long> entry : PENDING_RESPAWNS.entrySet())
|
||||
{
|
||||
if (time > entry.getValue().longValue())
|
||||
|
@@ -40,7 +40,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.taskmanager.tasks.TaskCleanUp;
|
||||
import org.l2jmobius.gameserver.taskmanager.tasks.TaskOlympiadSave;
|
||||
import org.l2jmobius.gameserver.taskmanager.tasks.TaskRaidPointsReset;
|
||||
@@ -94,7 +93,7 @@ public class TaskManager
|
||||
public void run()
|
||||
{
|
||||
task.onTimeElapsed(this);
|
||||
lastActivation = Chronos.currentTimeMillis();
|
||||
lastActivation = System.currentTimeMillis();
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection())
|
||||
{
|
||||
@@ -258,7 +257,7 @@ public class TaskManager
|
||||
try
|
||||
{
|
||||
final Date desired = DateFormat.getInstance().parse(task.getParams()[0]);
|
||||
final long diff = desired.getTime() - Chronos.currentTimeMillis();
|
||||
final long diff = desired.getTime() - System.currentTimeMillis();
|
||||
if (diff >= 0)
|
||||
{
|
||||
task.scheduled = ThreadPool.schedule(task, diff);
|
||||
@@ -305,7 +304,7 @@ public class TaskManager
|
||||
return false;
|
||||
}
|
||||
|
||||
long delay = min.getTimeInMillis() - Chronos.currentTimeMillis();
|
||||
long delay = min.getTimeInMillis() - System.currentTimeMillis();
|
||||
if (check.after(min) || (delay < 0))
|
||||
{
|
||||
delay += interval;
|
||||
|
@@ -31,7 +31,6 @@ import javax.swing.JPanel;
|
||||
import javax.swing.border.LineBorder;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.GameServer;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.util.Locator;
|
||||
@@ -43,7 +42,7 @@ public class SystemPanel extends JPanel
|
||||
{
|
||||
protected static final Logger LOGGER = Logger.getLogger(SystemPanel.class.getName());
|
||||
|
||||
protected static final long START_TIME = Chronos.currentTimeMillis();
|
||||
protected static final long START_TIME = System.currentTimeMillis();
|
||||
|
||||
public SystemPanel()
|
||||
{
|
||||
@@ -148,7 +147,7 @@ public class SystemPanel extends JPanel
|
||||
lblConnected.setText("Connected: " + playerCount);
|
||||
lblMaxConnected.setText("Max connected: " + World.MAX_CONNECTED_COUNT);
|
||||
lblOfflineShops.setText("Offline trade: " + World.OFFLINE_TRADE_COUNT);
|
||||
lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(Chronos.currentTimeMillis() - START_TIME));
|
||||
lblElapsedTime.setText("Elapsed: " + getDurationBreakdown(System.currentTimeMillis() - START_TIME));
|
||||
}
|
||||
}, 1000, 1000);
|
||||
}
|
||||
|
@@ -24,7 +24,6 @@ import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
||||
@@ -98,7 +97,7 @@ public class MinionList
|
||||
|
||||
public void moveMinionToRespawnList(Minion minion)
|
||||
{
|
||||
final Long current = Chronos.currentTimeMillis();
|
||||
final Long current = System.currentTimeMillis();
|
||||
_spawnedMinions.remove(minion);
|
||||
if (_respawnTasks.get(current) == null)
|
||||
{
|
||||
@@ -145,7 +144,7 @@ public class MinionList
|
||||
return;
|
||||
}
|
||||
|
||||
final Long current = Chronos.currentTimeMillis();
|
||||
final Long current = System.currentTimeMillis();
|
||||
if (_respawnTasks != null)
|
||||
{
|
||||
for (Entry<Long, Integer> entry : _respawnTasks.entrySet())
|
||||
|
@@ -26,7 +26,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
|
||||
/**
|
||||
* @author -Wooden-
|
||||
@@ -70,9 +69,9 @@ public abstract class FloodProtectedListener extends Thread
|
||||
if (fConnection != null)
|
||||
{
|
||||
fConnection.connectionNumber += 1;
|
||||
if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((Chronos.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
|
||||
if (((fConnection.connectionNumber > Config.FAST_CONNECTION_LIMIT) && ((System.currentTimeMillis() - fConnection.lastConnection) < Config.NORMAL_CONNECTION_TIME)) || ((System.currentTimeMillis() - fConnection.lastConnection) < Config.FAST_CONNECTION_TIME) || (fConnection.connectionNumber > Config.MAX_CONNECTION_PER_IP))
|
||||
{
|
||||
fConnection.lastConnection = Chronos.currentTimeMillis();
|
||||
fConnection.lastConnection = System.currentTimeMillis();
|
||||
connection.close();
|
||||
fConnection.connectionNumber -= 1;
|
||||
|
||||
@@ -91,11 +90,11 @@ public abstract class FloodProtectedListener extends Thread
|
||||
fConnection.isFlooding = false;
|
||||
LOGGER.info(connection.getInetAddress().getHostAddress() + " is not considered as flooding anymore.");
|
||||
}
|
||||
fConnection.lastConnection = Chronos.currentTimeMillis();
|
||||
fConnection.lastConnection = System.currentTimeMillis();
|
||||
}
|
||||
else
|
||||
{
|
||||
fConnection = new ForeignConnection(Chronos.currentTimeMillis());
|
||||
fConnection = new ForeignConnection(System.currentTimeMillis());
|
||||
_floodProtection.put(connection.getInetAddress().getHostAddress(), fConnection);
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,6 @@ import javax.crypto.Cipher;
|
||||
|
||||
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.loginserver.network.LoginClient;
|
||||
|
||||
@@ -311,7 +310,7 @@ public class LoginController
|
||||
{
|
||||
statement.setString(1, user);
|
||||
statement.setString(2, Base64.getEncoder().encodeToString(hash));
|
||||
statement.setLong(3, Chronos.currentTimeMillis());
|
||||
statement.setLong(3, System.currentTimeMillis());
|
||||
statement.setInt(4, 0);
|
||||
statement.setString(5, address.getHostAddress());
|
||||
statement.execute();
|
||||
@@ -342,7 +341,7 @@ public class LoginController
|
||||
client.setLastServer(lastServer);
|
||||
try (PreparedStatement statement = con.prepareStatement("UPDATE accounts SET lastactive=?, lastIP=? WHERE login=?"))
|
||||
{
|
||||
statement.setLong(1, Chronos.currentTimeMillis());
|
||||
statement.setLong(1, System.currentTimeMillis());
|
||||
statement.setString(2, address.getHostAddress());
|
||||
statement.setString(3, user);
|
||||
statement.execute();
|
||||
@@ -380,7 +379,7 @@ public class LoginController
|
||||
if (failedCount >= Config.LOGIN_TRY_BEFORE_BAN)
|
||||
{
|
||||
LOGGER.info("Banning '" + address.getHostAddress() + "' for " + Config.LOGIN_BLOCK_AFTER_BAN + " seconds due to " + failedCount + " invalid user/pass attempts");
|
||||
addBanForAddress(address.getHostAddress(), Chronos.currentTimeMillis() + (Config.LOGIN_BLOCK_AFTER_BAN * 1000));
|
||||
addBanForAddress(address.getHostAddress(), System.currentTimeMillis() + (Config.LOGIN_BLOCK_AFTER_BAN * 1000));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -449,7 +448,7 @@ public class LoginController
|
||||
|
||||
public boolean hasExpired()
|
||||
{
|
||||
return (Chronos.currentTimeMillis() > _time) && (_time > 0);
|
||||
return (System.currentTimeMillis() > _time) && (_time > 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -47,7 +47,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.LoginServerThread;
|
||||
import org.l2jmobius.gameserver.Shutdown;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
@@ -957,7 +956,7 @@ public class GameStatusThread extends Thread
|
||||
|
||||
private String getUptime(int time)
|
||||
{
|
||||
int uptime = (int) Chronos.currentTimeMillis() - time;
|
||||
int uptime = (int) System.currentTimeMillis() - time;
|
||||
uptime = uptime / 1000;
|
||||
final int h = uptime / 3600;
|
||||
final int m = (uptime - (h * 3600)) / 60;
|
||||
|
@@ -30,7 +30,6 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.enums.ServerMode;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
|
||||
public class TelnetStatusThread extends Thread
|
||||
@@ -125,7 +124,7 @@ public class TelnetStatusThread extends Thread
|
||||
}
|
||||
|
||||
statusServerSocket = new ServerSocket(_statusPort);
|
||||
_uptime = (int) Chronos.currentTimeMillis();
|
||||
_uptime = (int) System.currentTimeMillis();
|
||||
_loginStatus = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user