-More changes related to Javolution drop.

-Disabled html LazyCache by default.
This commit is contained in:
mobius
2015-02-09 13:11:58 +00:00
parent 303c3c65d2
commit 2452f7ea20
15 changed files with 35 additions and 65 deletions

View File

@@ -352,7 +352,7 @@ ForceInventoryUpdate = False
# True = Load html's into cache only on first time html is requested.
# False = Load all html's into cache on server startup.
# Default: True
LazyCache = True
LazyCache = False
# Cache all character names in to memory on server startup
# False - names are loaded from Db when they are requested

View File

@@ -37,6 +37,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.LogRecord;
@@ -104,7 +105,7 @@ public class LoginServerThread extends Thread
private final boolean _reserveHost;
private int _maxPlayer;
private final List<WaitingClient> _waitingClients;
private final ConcurrentHashMap<String, L2GameClient> _accountsInGameServer = new ConcurrentHashMap<>();
private final Map<String, L2GameClient> _accountsInGameServer = new ConcurrentHashMap<>();
private int _status;
private String _serverName;
private final List<String> _subnets;

View File

@@ -21,6 +21,7 @@ package com.l2jserver.gameserver;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
@@ -56,7 +57,7 @@ import com.l2jserver.util.Rnd;
public class RecipeController
{
protected static final ConcurrentHashMap<Integer, RecipeItemMaker> _activeMakers = new ConcurrentHashMap<>();
protected static final Map<Integer, RecipeItemMaker> _activeMakers = new ConcurrentHashMap<>();
protected RecipeController()
{

View File

@@ -49,7 +49,7 @@ public final class MercTicketManager
{
private static final Logger _log = Logger.getLogger(MercTicketManager.class.getName());
private static final CopyOnWriteArrayList<L2ItemInstance> _droppedTickets = new CopyOnWriteArrayList<>();
private static final List<L2ItemInstance> _droppedTickets = new CopyOnWriteArrayList<>();
// TODO: move all these values into siege.properties
// max tickets per merc type = 10 + (castleid * 2)?

View File

@@ -3002,8 +3002,7 @@ public class L2Clan implements IIdentifiable, INamable
list.add(new SubPledgeSkill(subunit.getId(), skill.getId(), skill.getLevel()));
}
}
SubPledgeSkill[] result = list.toArray(new SubPledgeSkill[list.size()]);
return result;
return list.toArray(new SubPledgeSkill[list.size()]);
}
public void setNewLeaderId(int objectId, boolean storeInDb)

View File

@@ -83,7 +83,7 @@ public class L2Party extends AbstractPlayerGroup
private static final Duration PARTY_POSITION_BROADCAST_INTERVAL = Duration.ofSeconds(12);
private static final Duration PARTY_DISTRIBUTION_TYPE_REQUEST_TIMEOUT = Duration.ofSeconds(15);
private final CopyOnWriteArrayList<L2PcInstance> _members;
private final List<L2PcInstance> _members;
private boolean _pendingInvitation = false;
private long _pendingInviteTimeout;
private int _partyLvl = 0;
@@ -769,11 +769,11 @@ public class L2Party extends AbstractPlayerGroup
public void distributeAdena(L2PcInstance player, long adena, L2Character target)
{
// Get all the party members
List<L2PcInstance> membersList = getMembers();
final List<L2PcInstance> membersList = getMembers();
// Check the number of party members that must be rewarded
// (The party member must be in range to receive its reward)
List<L2PcInstance> ToReward = new ArrayList<>();
final List<L2PcInstance> ToReward = new ArrayList<>();
for (L2PcInstance member : membersList)
{
if (!Util.checkIfInRange(Config.ALT_PARTY_RANGE2, target, member, true))
@@ -791,7 +791,7 @@ public class L2Party extends AbstractPlayerGroup
// Now we can actually distribute the adena reward
// (Total adena splitted by the number of party members that are in range and must be rewarded)
long count = adena / ToReward.size();
final long count = adena / ToReward.size();
for (L2PcInstance member : ToReward)
{
member.addAdena("Party", count, player, true);

View File

@@ -134,8 +134,7 @@ public class TradeList
inventory.adjustAvailableItem(item);
list.add(item);
}
final TradeItem[] result = list.toArray(new TradeItem[list.size()]);
return result;
return list.toArray(new TradeItem[list.size()]);
}
/**

View File

@@ -777,7 +777,7 @@ public final class L2PcInstance extends L2Playable
/** Player's cubics. */
private final Map<Integer, L2CubicInstance> _cubics = new ConcurrentSkipListMap<>();
/** Active shots. */
protected CopyOnWriteArraySet<Integer> _activeSoulShots = new CopyOnWriteArraySet<>();
protected Set<Integer> _activeSoulShots = new CopyOnWriteArraySet<>();
public final ReentrantLock soulShotLock = new ReentrantLock();

View File

@@ -169,10 +169,7 @@ public class PcInventory extends Inventory
list.add(item);
}
}
L2ItemInstance[] result = list.toArray(new L2ItemInstance[list.size()]);
return result;
return list.toArray(new L2ItemInstance[list.size()]);
}
/**
@@ -219,10 +216,7 @@ public class PcInventory extends Inventory
list.add(item);
}
}
L2ItemInstance[] result = list.toArray(new L2ItemInstance[list.size()]);
return result;
return list.toArray(new L2ItemInstance[list.size()]);
}
/**
@@ -255,10 +249,7 @@ public class PcInventory extends Inventory
list.add(item);
}
}
L2ItemInstance[] result = list.toArray(new L2ItemInstance[list.size()]);
return result;
return list.toArray(new L2ItemInstance[list.size()]);
}
/**
@@ -293,10 +284,7 @@ public class PcInventory extends Inventory
list.add(item);
}
}
L2ItemInstance[] result = list.toArray(new L2ItemInstance[list.size()]);
return result;
return list.toArray(new L2ItemInstance[list.size()]);
}
/**
@@ -326,10 +314,7 @@ public class PcInventory extends Inventory
list.add(item);
}
}
L2ItemInstance[] result = list.toArray(new L2ItemInstance[list.size()]);
return result;
return list.toArray(new L2ItemInstance[list.size()]);
}
/**
@@ -346,10 +331,7 @@ public class PcInventory extends Inventory
list.add(item);
}
}
L2ItemInstance[] result = list.toArray(new L2ItemInstance[list.size()]);
return result;
return list.toArray(new L2ItemInstance[list.size()]);
}
/**
@@ -366,10 +348,7 @@ public class PcInventory extends Inventory
list.add(item);
}
}
L2ItemInstance[] result = list.toArray(new L2ItemInstance[list.size()]);
return result;
return list.toArray(new L2ItemInstance[list.size()]);
}
/**
@@ -391,10 +370,7 @@ public class PcInventory extends Inventory
}
}
}
TradeItem[] result = list.toArray(new TradeItem[list.size()]);
return result;
return list.toArray(new TradeItem[list.size()]);
}
/**

View File

@@ -453,7 +453,7 @@ public class MultiSellChoose extends L2GameClientPacket
}
finally
{
augmentation.clear(); // ?
augmentation.clear();
}
// finally, give the tax to the castle...

View File

@@ -35,14 +35,12 @@ public class ScriptPackage
{
private static final Logger _log = Logger.getLogger(ScriptPackage.class.getName());
private final List<ScriptDocument> _scriptFiles;
private final List<String> _otherFiles;
private final List<ScriptDocument> _scriptFiles = new ArrayList<>();
private final List<String> _otherFiles = new ArrayList<>();
private final String _name;
public ScriptPackage(ZipFile pack)
{
_scriptFiles = new ArrayList<>();
_otherFiles = new ArrayList<>();
_name = pack.getName();
addFiles(pack);
}
@@ -75,8 +73,7 @@ public class ScriptPackage
{
try
{
ScriptDocument newScript = new ScriptDocument(entry.getName(), pack.getInputStream(entry));
_scriptFiles.add(newScript);
_scriptFiles.add(new ScriptDocument(entry.getName(), pack.getInputStream(entry)));
}
catch (IOException io)
{

View File

@@ -27,12 +27,12 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -60,8 +60,8 @@ public final class TaskManager
{
protected static final Logger _log = Logger.getLogger(TaskManager.class.getName());
private final Map<Integer, Task> _tasks = new ConcurrentHashMap<>();
protected final List<ExecutedTask> _currentTasks = new CopyOnWriteArrayList<>();
private final Map<Integer, Task> _tasks = new HashMap<>();
protected final List<ExecutedTask> _currentTasks = new ArrayList<>();
protected static final String[] SQL_STATEMENTS =
{

View File

@@ -45,7 +45,7 @@ public class MinionList
protected final L2MonsterInstance _master;
/** List containing the current spawned minions */
private final List<L2MonsterInstance> _minionReferences;
private final List<L2MonsterInstance> _minionReferences = new CopyOnWriteArrayList<>();
/** List containing the cached deleted minions for reuse */
protected List<L2MonsterInstance> _reusedMinionReferences = null;
@@ -57,7 +57,6 @@ public class MinionList
}
_master = pMaster;
_minionReferences = new CopyOnWriteArrayList<>();
}
/**

View File

@@ -29,6 +29,7 @@ import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.StringJoiner;
import java.util.StringTokenizer;
import java.util.logging.Logger;
@@ -307,16 +308,13 @@ public final class Util
*/
public static String implodeString(Iterable<String> strArray, String strDelim)
{
final StringBuilder sbString = new StringBuilder();
final StringJoiner sj = new StringJoiner(strDelim);
for (String strValue : strArray)
{
sbString.append(strValue);
sbString.append(strDelim);
sj.add(strValue);
}
String result = sbString.toString();
return result;
return sj.toString();
}
/**

View File

@@ -61,7 +61,7 @@ public class LoginController
public static final int LOGIN_TIMEOUT = 60 * 1000;
/** Authed Clients on LoginServer */
protected ConcurrentHashMap<String, L2LoginClient> _loginServerClients = new ConcurrentHashMap<>();
protected Map<String, L2LoginClient> _loginServerClients = new ConcurrentHashMap<>();
private final Map<InetAddress, Integer> _failedLoginAttemps = new HashMap<>();
private final Map<InetAddress, Long> _bannedIps = new ConcurrentHashMap<>();