Dropped IGameXmlReader.

ScriptEngineManager class cleanup.
Use of ThreadPool to decrease startup time.
This commit is contained in:
MobiusDevelopment
2019-04-05 04:14:32 +00:00
parent e5fd371ae8
commit eed915b9dc
1036 changed files with 4975 additions and 6228 deletions

View File

@@ -54,7 +54,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.PropertiesParser;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
@@ -3691,7 +3691,7 @@ public final class Config
return result;
}
private static class IPConfigData implements IGameXmlReader
private static class IPConfigData implements IXmlReader
{
private static final List<String> _subnets = new ArrayList<>(5);
private static final List<String> _hosts = new ArrayList<>(5);

View File

@@ -1,118 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.commons.util;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.holders.MinionHolder;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
/**
* Interface for XML parsers.
* @author Zoey76
*/
public interface IGameXmlReader extends IXmlReader
{
/**
* Wrapper for {@link #parseFile(File)} method.
* @param path the relative path to the datapack root of the XML file to parse.
*/
default void parseDatapackFile(String path)
{
parseFile(new File(Config.DATAPACK_ROOT, path));
}
/**
* Wrapper for {@link #parseDirectory(File, boolean)}.
* @param path the path to the directory where the XML files are
* @param recursive parses all sub folders if there is
* @return {@code false} if it fails to find the directory, {@code true} otherwise
*/
default boolean parseDatapackDirectory(String path, boolean recursive)
{
return parseDirectory(new File(Config.DATAPACK_ROOT, path), recursive);
}
/**
* @param n
* @return a map of parameters
*/
default Map<String, Object> parseParameters(Node n)
{
final Map<String, Object> parameters = new HashMap<>();
for (Node parameters_node = n.getFirstChild(); parameters_node != null; parameters_node = parameters_node.getNextSibling())
{
NamedNodeMap attrs = parameters_node.getAttributes();
switch (parameters_node.getNodeName().toLowerCase())
{
case "param":
{
parameters.put(parseString(attrs, "name"), parseString(attrs, "value"));
break;
}
case "skill":
{
parameters.put(parseString(attrs, "name"), new SkillHolder(parseInteger(attrs, "id"), parseInteger(attrs, "level")));
break;
}
case "location":
{
parameters.put(parseString(attrs, "name"), new Location(parseInteger(attrs, "x"), parseInteger(attrs, "y"), parseInteger(attrs, "z"), parseInteger(attrs, "heading", 0)));
break;
}
case "minions":
{
final List<MinionHolder> minions = new ArrayList<>(1);
for (Node minions_node = parameters_node.getFirstChild(); minions_node != null; minions_node = minions_node.getNextSibling())
{
if (minions_node.getNodeName().equalsIgnoreCase("npc"))
{
attrs = minions_node.getAttributes();
minions.add(new MinionHolder(parseInteger(attrs, "id"), parseInteger(attrs, "count"), parseInteger(attrs, "respawnTime"), parseInteger(attrs, "weightPoint")));
}
}
if (!minions.isEmpty())
{
parameters.put(parseString(parameters_node.getAttributes(), "name"), minions);
}
break;
}
}
}
return parameters;
}
default Location parseLocation(Node n)
{
final NamedNodeMap attrs = n.getAttributes();
final int x = parseInteger(attrs, "x");
final int y = parseInteger(attrs, "y");
final int z = parseInteger(attrs, "z");
final int heading = parseInteger(attrs, "heading", 0);
return new Location(x, y, z, heading);
}
}

View File

@@ -18,8 +18,13 @@ package com.l2jmobius.commons.util;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.logging.Level;
@@ -35,7 +40,12 @@ import org.w3c.dom.NodeList;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXParseException;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.file.filter.XMLFilter;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.holders.MinionHolder;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
/**
* Interface for XML parsers.
@@ -56,6 +66,15 @@ public interface IXmlReader
*/
void load();
/**
* Wrapper for {@link #parseFile(File)} method.
* @param path the relative path to the datapack root of the XML file to parse.
*/
default void parseDatapackFile(String path)
{
parseFile(new File(Config.DATAPACK_ROOT, path));
}
/**
* Parses a single XML file.<br>
* If the file was successfully parsed, call {@link #parseDocument(Document, File)} for the parsed document.<br>
@@ -121,6 +140,17 @@ public interface IXmlReader
return parseDirectory(file, false);
}
/**
* Wrapper for {@link #parseDirectory(File, boolean)}.
* @param path the path to the directory where the XML files are
* @param recursive parses all sub folders if there is
* @return {@code false} if it fails to find the directory, {@code true} otherwise
*/
default boolean parseDatapackDirectory(String path, boolean recursive)
{
return parseDirectory(new File(Config.DATAPACK_ROOT, path), recursive);
}
/**
* Loads all XML files from {@code path} and calls {@link #parseFile(File)} for each one of them.
* @param dir the directory object to scan.
@@ -135,6 +165,7 @@ public interface IXmlReader
return false;
}
final List<ScheduledFuture<?>> jobs = new CopyOnWriteArrayList<>();
final File[] listOfFiles = dir.listFiles();
for (File f : listOfFiles)
{
@@ -144,9 +175,23 @@ public interface IXmlReader
}
else if (getCurrentFileFilter().accept(f))
{
parseFile(f);
jobs.add(ThreadPool.schedule(() ->
{
parseFile(f);
}, 0));
}
}
while (!jobs.isEmpty())
{
for (ScheduledFuture<?> job : jobs)
{
if ((job == null) || job.isDone() || job.isCancelled())
{
jobs.remove(job);
}
}
}
return true;
}
@@ -531,6 +576,16 @@ public interface IXmlReader
return parseString(attrs.getNamedItem(name), defaultValue);
}
default Location parseLocation(Node n)
{
final NamedNodeMap attrs = n.getAttributes();
final int x = parseInteger(attrs, "x");
final int y = parseInteger(attrs, "y");
final int z = parseInteger(attrs, "z");
final int heading = parseInteger(attrs, "heading", 0);
return new Location(x, y, z, heading);
}
/**
* Parses an enumerated value.
* @param <T> the enumerated type
@@ -612,6 +667,56 @@ public interface IXmlReader
return map;
}
/**
* @param n
* @return a map of parameters
*/
default Map<String, Object> parseParameters(Node n)
{
final Map<String, Object> parameters = new HashMap<>();
for (Node parameters_node = n.getFirstChild(); parameters_node != null; parameters_node = parameters_node.getNextSibling())
{
NamedNodeMap attrs = parameters_node.getAttributes();
switch (parameters_node.getNodeName().toLowerCase())
{
case "param":
{
parameters.put(parseString(attrs, "name"), parseString(attrs, "value"));
break;
}
case "skill":
{
parameters.put(parseString(attrs, "name"), new SkillHolder(parseInteger(attrs, "id"), parseInteger(attrs, "level")));
break;
}
case "location":
{
parameters.put(parseString(attrs, "name"), new Location(parseInteger(attrs, "x"), parseInteger(attrs, "y"), parseInteger(attrs, "z"), parseInteger(attrs, "heading", 0)));
break;
}
case "minions":
{
final List<MinionHolder> minions = new ArrayList<>(1);
for (Node minions_node = parameters_node.getFirstChild(); minions_node != null; minions_node = minions_node.getNextSibling())
{
if (minions_node.getNodeName().equalsIgnoreCase("npc"))
{
attrs = minions_node.getAttributes();
minions.add(new MinionHolder(parseInteger(attrs, "id"), parseInteger(attrs, "count"), parseInteger(attrs, "respawnTime"), parseInteger(attrs, "weightPoint")));
}
}
if (!minions.isEmpty())
{
parameters.put(parseString(parameters_node.getAttributes(), "name"), minions);
}
break;
}
}
}
return parameters;
}
/**
* Executes action for each child of node
* @param node

View File

@@ -344,7 +344,7 @@ public class GameServer
try
{
LOGGER.info("Loading server scripts...");
ScriptEngineManager.getInstance().executeMasterHandler();
ScriptEngineManager.getInstance().executeScript(ScriptEngineManager.MASTER_HANDLER_FILE);
ScriptEngineManager.getInstance().executeScriptList();
}
catch (Exception e)

View File

@@ -29,7 +29,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.AccessLevel;
import com.l2jmobius.gameserver.model.AdminCommandAccessRight;
import com.l2jmobius.gameserver.model.StatsSet;
@@ -42,7 +42,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
* Loads administrator access levels and commands.
* @author UnAfraid
*/
public final class AdminData implements IGameXmlReader
public final class AdminData implements IXmlReader
{
private final Map<Integer, AccessLevel> _accessLevels = new HashMap<>();
private final Map<String, AdminCommandAccessRight> _adminCommandAccessRights = new HashMap<>();

View File

@@ -17,14 +17,14 @@
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.ArmorSet;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -32,9 +32,9 @@ import com.l2jmobius.gameserver.model.holders.SkillHolder;
* Loads armor set bonuses.
* @author godson, Luno, UnAfraid
*/
public final class ArmorSetsData implements IGameXmlReader
public final class ArmorSetsData implements IXmlReader
{
private final Map<Integer, ArmorSet> _armorSets = new HashMap<>();
private final Map<Integer, ArmorSet> _armorSets = new ConcurrentHashMap<>();
/**
* Instantiates a new armor sets data.

View File

@@ -21,8 +21,8 @@ import java.io.FileFilter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -32,7 +32,7 @@ import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.file.filter.NumericNameFilter;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.model.buylist.BuyListHolder;
@@ -43,11 +43,11 @@ import com.l2jmobius.gameserver.model.items.Item;
* Loads buy lists for NPCs.
* @author NosBit
*/
public final class BuyListData implements IGameXmlReader
public final class BuyListData implements IXmlReader
{
private static final Logger LOGGER = Logger.getLogger(BuyListData.class.getName());
private final Map<Integer, BuyListHolder> _buyLists = new HashMap<>();
private final Map<Integer, BuyListHolder> _buyLists = new ConcurrentHashMap<>();
private static final FileFilter NUMERIC_FILTER = new NumericNameFilter();
protected BuyListData()

View File

@@ -28,14 +28,14 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.enums.CategoryType;
/**
* Loads the category data with Class or NPC IDs.
* @author NosBit, xban1x
*/
public final class CategoryData implements IGameXmlReader
public final class CategoryData implements IXmlReader
{
private static final Logger LOGGER = Logger.getLogger(CategoryData.class.getName());

View File

@@ -24,7 +24,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.base.ClassId;
import com.l2jmobius.gameserver.model.base.ClassInfo;
@@ -32,7 +32,7 @@ import com.l2jmobius.gameserver.model.base.ClassInfo;
* Loads the the list of classes and it's info.
* @author Zoey76
*/
public final class ClassListData implements IGameXmlReader
public final class ClassListData implements IXmlReader
{
private final Map<ClassId, ClassInfo> _classData = new HashMap<>();

View File

@@ -29,7 +29,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.MapRegionManager;
import com.l2jmobius.gameserver.model.Location;
@@ -41,7 +41,7 @@ import com.l2jmobius.gameserver.model.actor.templates.DoorTemplate;
* Loads doors.
* @author JIV, GodKratos, UnAfraid
*/
public class DoorData implements IGameXmlReader
public class DoorData implements IXmlReader
{
private static final Map<String, Set<Integer>> _groups = new HashMap<>();
private final Map<Integer, DoorInstance> _doors = new HashMap<>();

View File

@@ -25,7 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.items.enchant.EnchantScroll;
import com.l2jmobius.gameserver.model.items.enchant.EnchantSupportItem;
@@ -35,7 +35,7 @@ import com.l2jmobius.gameserver.model.items.instance.ItemInstance;
* Loads item enchant data.
* @author UnAfraid
*/
public class EnchantItemData implements IGameXmlReader
public class EnchantItemData implements IXmlReader
{
private final Map<Integer, EnchantScroll> _scrolls = new HashMap<>();
private final Map<Integer, EnchantSupportItem> _supports = new HashMap<>();

View File

@@ -25,7 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.model.holders.RangeChanceHolder;
import com.l2jmobius.gameserver.model.items.Item;
@@ -37,7 +37,7 @@ import com.l2jmobius.gameserver.util.Util;
/**
* @author UnAfraid
*/
public final class EnchantItemGroupsData implements IGameXmlReader
public final class EnchantItemGroupsData implements IXmlReader
{
private final Map<String, EnchantItemGroup> _itemGroups = new HashMap<>();
private final Map<Integer, EnchantScrollGroup> _scrollGroups = new HashMap<>();

View File

@@ -26,7 +26,7 @@ import java.util.Map;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.enums.StatFunction;
import com.l2jmobius.gameserver.model.items.Item;
@@ -39,7 +39,7 @@ import com.l2jmobius.gameserver.model.stats.functions.FuncTemplate;
* This class holds the Enchant HP Bonus Data.
* @author MrPoke, Zoey76
*/
public class EnchantItemHPBonusData implements IGameXmlReader
public class EnchantItemHPBonusData implements IXmlReader
{
private final Map<CrystalType, List<Integer>> _armorHPBonuses = new EnumMap<>(CrystalType.class);

View File

@@ -24,7 +24,7 @@ import java.util.logging.Level;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.items.instance.ItemInstance;
import com.l2jmobius.gameserver.model.options.EnchantOptions;
import com.l2jmobius.gameserver.util.Util;
@@ -32,7 +32,7 @@ import com.l2jmobius.gameserver.util.Util;
/**
* @author UnAfraid
*/
public class EnchantItemOptionsData implements IGameXmlReader
public class EnchantItemOptionsData implements IXmlReader
{
private final Map<Integer, Map<Integer, EnchantOptions>> _data = new HashMap<>();

View File

@@ -26,7 +26,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.EnchantSkillGroup;
import com.l2jmobius.gameserver.model.EnchantSkillGroup.EnchantSkillHolder;
import com.l2jmobius.gameserver.model.EnchantSkillLearn;
@@ -38,7 +38,7 @@ import com.l2jmobius.gameserver.model.skills.Skill;
* This class holds the Enchant Groups information.
* @author Micr0
*/
public class EnchantSkillGroupsData implements IGameXmlReader
public class EnchantSkillGroupsData implements IXmlReader
{
public static final int NORMAL_ENCHANT_COST_MULTIPLIER = Config.NORMAL_ENCHANT_COST_MULTIPLIER;
public static final int SAFE_ENCHANT_COST_MULTIPLIER = Config.SAFE_ENCHANT_COST_MULTIPLIER;

View File

@@ -24,13 +24,13 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
/**
* This class holds the Experience points for each level for players and pets.
* @author mrTJO
*/
public final class ExperienceData implements IGameXmlReader
public final class ExperienceData implements IXmlReader
{
private final Map<Integer, Long> _expTable = new HashMap<>();

View File

@@ -26,7 +26,7 @@ import java.util.logging.Logger;
import org.w3c.dom.Document;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
@@ -35,7 +35,7 @@ import com.l2jmobius.gameserver.model.holders.FakePlayerHolder;
/**
* @author Mobius
*/
public class FakePlayerData implements IGameXmlReader
public class FakePlayerData implements IXmlReader
{
private static Logger LOGGER = Logger.getLogger(FakePlayerData.class.getName());

View File

@@ -28,7 +28,7 @@ import java.util.logging.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.enums.FenceState;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.World;
@@ -38,7 +38,7 @@ import com.l2jmobius.gameserver.model.actor.instance.FenceInstance;
/**
* @author HoridoJoho / FBIagent
*/
public final class FenceData implements IGameXmlReader
public final class FenceData implements IXmlReader
{
private static final Logger LOGGER = Logger.getLogger(FenceData.class.getSimpleName());

View File

@@ -26,7 +26,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.fishing.Fish;
@@ -34,7 +34,7 @@ import com.l2jmobius.gameserver.model.fishing.Fish;
* This class holds the Fish information.
* @author nonom
*/
public final class FishData implements IGameXmlReader
public final class FishData implements IXmlReader
{
private final Map<Integer, Fish> _fishNormal = new HashMap<>();
private final Map<Integer, Fish> _fishEasy = new HashMap<>();

View File

@@ -24,7 +24,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.fishing.FishingMonster;
@@ -32,7 +32,7 @@ import com.l2jmobius.gameserver.model.fishing.FishingMonster;
* This class holds the Fishing Monsters information.
* @author nonom
*/
public final class FishingMonstersData implements IGameXmlReader
public final class FishingMonstersData implements IXmlReader
{
private final Map<Integer, FishingMonster> _fishingMonstersData = new HashMap<>();

View File

@@ -24,7 +24,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.fishing.FishingRod;
@@ -32,7 +32,7 @@ import com.l2jmobius.gameserver.model.fishing.FishingRod;
* This class holds the Fishing Rods information.
* @author nonom
*/
public final class FishingRodsData implements IGameXmlReader
public final class FishingRodsData implements IXmlReader
{
private final Map<Integer, FishingRod> _fishingRods = new HashMap<>();

View File

@@ -26,7 +26,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.base.ClassId;
import com.l2jmobius.gameserver.model.items.Henna;
@@ -38,7 +38,7 @@ import com.l2jmobius.gameserver.model.items.Henna;
* Allowed classes to wear each henna.
* @author Zoey76
*/
public final class HennaData implements IGameXmlReader
public final class HennaData implements IXmlReader
{
private final Map<Integer, Henna> _hennaList = new HashMap<>();

View File

@@ -22,7 +22,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.model.actor.Creature;
@@ -30,7 +30,7 @@ import com.l2jmobius.gameserver.model.actor.Creature;
* This class load, holds and calculates the hit condition bonuses.
* @author Nik
*/
public final class HitConditionBonusData implements IGameXmlReader
public final class HitConditionBonusData implements IXmlReader
{
private int frontBonus = 0;
private int sideBonus = 0;

View File

@@ -27,7 +27,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.base.ClassId;
import com.l2jmobius.gameserver.model.items.PlayerItemTemplate;
@@ -37,7 +37,7 @@ import com.l2jmobius.gameserver.model.items.PlayerItemTemplate;
* What items get each newly created character and if this item is equipped upon creation (<b>Requires the item to be equippable</b>).
* @author Zoey76
*/
public final class InitialEquipmentData implements IGameXmlReader
public final class InitialEquipmentData implements IXmlReader
{
private final Map<ClassId, List<PlayerItemTemplate>> _initialEquipmentList = new HashMap<>();
private static final String NORMAL = "data/stats/initialEquipment.xml";

View File

@@ -26,7 +26,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.enums.MacroType;
import com.l2jmobius.gameserver.enums.ShortcutType;
import com.l2jmobius.gameserver.model.Macro;
@@ -42,7 +42,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ShortCutRegister;
* What shortcuts get each newly created character.
* @author Zoey76
*/
public final class InitialShortcutData implements IGameXmlReader
public final class InitialShortcutData implements IXmlReader
{
private final Map<ClassId, List<Shortcut>> _initialShortcutData = new HashMap<>();
private final List<Shortcut> _initialGlobalShortcutList = new ArrayList<>();

View File

@@ -25,12 +25,12 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
/**
* @author UnAfraid
*/
public class KarmaData implements IGameXmlReader
public class KarmaData implements IXmlReader
{
private final Map<Integer, Double> _karmaTable = new HashMap<>();

View File

@@ -18,9 +18,9 @@ package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.io.FileFilter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import org.w3c.dom.DOMException;
@@ -29,7 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.file.filter.NumericNameFilter;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.Npc;
@@ -45,9 +45,9 @@ import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
import com.l2jmobius.gameserver.util.Util;
public final class MultisellData implements IGameXmlReader
public final class MultisellData implements IXmlReader
{
private final Map<Integer, ListContainer> _entries = new HashMap<>();
private final Map<Integer, ListContainer> _entries = new ConcurrentHashMap<>();
public static final int PAGE_SIZE = 40;
// Special IDs.

View File

@@ -25,6 +25,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@@ -34,7 +36,7 @@ import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.enums.AISkillScope;
import com.l2jmobius.gameserver.enums.DropType;
@@ -51,11 +53,11 @@ import com.l2jmobius.gameserver.model.skills.Skill;
* NPC data parser.
* @author NosBit
*/
public class NpcData implements IGameXmlReader
public class NpcData implements IXmlReader
{
private final Map<Integer, NpcTemplate> _npcs = new HashMap<>();
private final Map<String, Integer> _clans = new HashMap<>();
private static final List<Integer> _masterMonsterIDs = new ArrayList<>();
private final Map<Integer, NpcTemplate> _npcs = new ConcurrentHashMap<>();
private final Map<String, Integer> _clans = new ConcurrentHashMap<>();
private static final List<Integer> _masterMonsterIDs = new CopyOnWriteArrayList<>();
protected NpcData()
{

View File

@@ -17,15 +17,15 @@
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.options.Options;
import com.l2jmobius.gameserver.model.options.OptionsSkillHolder;
@@ -37,9 +37,9 @@ import com.l2jmobius.gameserver.model.stats.functions.FuncTemplate;
* Item Option data.
* @author UnAfraid
*/
public class OptionData implements IGameXmlReader
public class OptionData implements IXmlReader
{
private final Map<Integer, Options> _optionData = new HashMap<>();
private final Map<Integer, Options> _optionData = new ConcurrentHashMap<>();
protected OptionData()
{

View File

@@ -17,14 +17,14 @@
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.enums.MountType;
import com.l2jmobius.gameserver.model.PetData;
import com.l2jmobius.gameserver.model.PetLevelData;
@@ -35,9 +35,9 @@ import com.l2jmobius.gameserver.model.StatsSet;
* TODO: load and use all pet parameters.
* @author Zoey76 (rework)
*/
public final class PetDataTable implements IGameXmlReader
public final class PetDataTable implements IXmlReader
{
private final Map<Integer, PetData> _pets = new HashMap<>();
private final Map<Integer, PetData> _pets = new ConcurrentHashMap<>();
/**
* Instantiates a new pet data table.

View File

@@ -27,14 +27,14 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.actor.Summon;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
/**
* @author Mobius
*/
public class PetSkillData implements IGameXmlReader
public class PetSkillData implements IXmlReader
{
private static Logger LOGGER = Logger.getLogger(PetSkillData.class.getName());
private final Map<Integer, Map<Long, SkillHolder>> _skillTrees = new HashMap<>();

View File

@@ -18,16 +18,16 @@ package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.templates.PlayerTemplate;
@@ -37,11 +37,11 @@ import com.l2jmobius.gameserver.model.base.ClassId;
* Loads player's base stats.
* @author Forsaiken, Zoey76, GKR
*/
public final class PlayerTemplateData implements IGameXmlReader
public final class PlayerTemplateData implements IXmlReader
{
private static final Logger LOGGER = Logger.getLogger(PlayerTemplateData.class.getName());
private final Map<ClassId, PlayerTemplate> _playerTemplates = new HashMap<>();
private final Map<ClassId, PlayerTemplate> _playerTemplates = new ConcurrentHashMap<>();
private int _dataCount = 0;

View File

@@ -23,13 +23,13 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
/**
* This class holds the Player Xp Percent Lost Data for each level for players.
* @author Zealar
*/
public final class PlayerXpPercentLostData implements IGameXmlReader
public final class PlayerXpPercentLostData implements IXmlReader
{
private final int _maxlevel = ExperienceData.getInstance().getMaxLevel();
private final double[] _playerXpPercentLost = new double[_maxlevel + 1];

View File

@@ -27,14 +27,14 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.holders.PrimeShopProductHolder;
/**
* @author Mobius
*/
public class PrimeShopData implements IGameXmlReader
public class PrimeShopData implements IXmlReader
{
private static final Logger LOGGER = Logger.getLogger(PrimeShopData.class.getName());
private final Map<Integer, PrimeShopProductHolder> _products = new HashMap<>();

View File

@@ -26,7 +26,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.RecipeInstance;
import com.l2jmobius.gameserver.model.RecipeList;
import com.l2jmobius.gameserver.model.RecipeStatInstance;
@@ -37,7 +37,7 @@ import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
* The Class RecipeData.
* @author Zoey76
*/
public class RecipeData implements IGameXmlReader
public class RecipeData implements IXmlReader
{
private final Map<Integer, RecipeList> _recipes = new HashMap<>();

View File

@@ -24,13 +24,13 @@ import java.util.logging.Level;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
/**
* Secondary Auth data.
* @author NosBit
*/
public class SecondaryAuthData implements IGameXmlReader
public class SecondaryAuthData implements IXmlReader
{
private final Set<String> _forbiddenPasswords = new HashSet<>();
private boolean _enabled = false;

View File

@@ -26,7 +26,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.SiegeScheduleDate;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.util.Util;
@@ -34,7 +34,7 @@ import com.l2jmobius.gameserver.util.Util;
/**
* @author UnAfraid
*/
public class SiegeScheduleData implements IGameXmlReader
public class SiegeScheduleData implements IXmlReader
{
private final List<SiegeScheduleDate> _scheduleData = new ArrayList<>();

View File

@@ -16,10 +16,9 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.engines.DocumentEngine;
@@ -32,9 +31,9 @@ public final class SkillData
{
private static Logger LOGGER = Logger.getLogger(SkillData.class.getName());
private final Map<Integer, Skill> _skills = new HashMap<>();
private final Map<Integer, Integer> _skillMaxLevel = new HashMap<>();
private final Set<Integer> _enchantable = new HashSet<>();
private final Map<Integer, Skill> _skills = new ConcurrentHashMap<>();
private final Map<Integer, Integer> _skillMaxLevel = new ConcurrentHashMap<>();
private final Set<Integer> _enchantable = ConcurrentHashMap.newKeySet();
protected SkillData()
{
@@ -50,11 +49,11 @@ public final class SkillData
private void load()
{
final Map<Integer, Skill> _temp = new HashMap<>();
DocumentEngine.getInstance().loadAllSkills(_temp);
final Map<Integer, Skill> temp = new ConcurrentHashMap<>();
DocumentEngine.getInstance().loadAllSkills(temp);
_skills.clear();
_skills.putAll(_temp);
_skills.putAll(temp);
_skillMaxLevel.clear();
_enchantable.clear();

View File

@@ -25,14 +25,14 @@ import java.util.Map;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.base.ClassId;
/**
* Holds all skill learn data for all NPCs.
* @author xban1x
*/
public final class SkillLearnData implements IGameXmlReader
public final class SkillLearnData implements IXmlReader
{
private final Map<Integer, List<ClassId>> _skillLearn = new HashMap<>();

View File

@@ -27,13 +27,14 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.SkillLearn;
import com.l2jmobius.gameserver.model.SkillLearn.SubClassData;
@@ -72,24 +73,24 @@ import com.l2jmobius.gameserver.model.skills.Skill;
* For XML schema please refer to skillTrees.xsd in datapack in xsd folder and for parameters documentation refer to documentation.txt in skillTrees folder.<br>
* @author Zoey76
*/
public final class SkillTreesData implements IGameXmlReader
public final class SkillTreesData implements IXmlReader
{
// ClassId, Map of Skill Hash Code, SkillLearn
private final Map<ClassId, Map<Integer, SkillLearn>> _classSkillTrees = new LinkedHashMap<>();
private final Map<ClassId, Map<Integer, SkillLearn>> _transferSkillTrees = new LinkedHashMap<>();
private final Map<ClassId, Map<Integer, SkillLearn>> _classSkillTrees = new ConcurrentHashMap<>();
private final Map<ClassId, Map<Integer, SkillLearn>> _transferSkillTrees = new ConcurrentHashMap<>();
// Skill Hash Code, SkillLearn
private final Map<Integer, SkillLearn> _collectSkillTree = new LinkedHashMap<>();
private final Map<Integer, SkillLearn> _fishingSkillTree = new LinkedHashMap<>();
private final Map<Integer, SkillLearn> _pledgeSkillTree = new LinkedHashMap<>();
private final Map<Integer, SkillLearn> _subClassSkillTree = new LinkedHashMap<>();
private final Map<Integer, SkillLearn> _subPledgeSkillTree = new LinkedHashMap<>();
private final Map<Integer, SkillLearn> _transformSkillTree = new LinkedHashMap<>();
private final Map<Integer, SkillLearn> _commonSkillTree = new LinkedHashMap<>();
private final Map<Integer, SkillLearn> _collectSkillTree = new ConcurrentHashMap<>();
private final Map<Integer, SkillLearn> _fishingSkillTree = new ConcurrentHashMap<>();
private final Map<Integer, SkillLearn> _pledgeSkillTree = new ConcurrentHashMap<>();
private final Map<Integer, SkillLearn> _subClassSkillTree = new ConcurrentHashMap<>();
private final Map<Integer, SkillLearn> _subPledgeSkillTree = new ConcurrentHashMap<>();
private final Map<Integer, SkillLearn> _transformSkillTree = new ConcurrentHashMap<>();
private final Map<Integer, SkillLearn> _commonSkillTree = new ConcurrentHashMap<>();
// Other skill trees
private final Map<Integer, SkillLearn> _nobleSkillTree = new LinkedHashMap<>();
private final Map<Integer, SkillLearn> _heroSkillTree = new LinkedHashMap<>();
private final Map<Integer, SkillLearn> _gameMasterSkillTree = new LinkedHashMap<>();
private final Map<Integer, SkillLearn> _gameMasterAuraSkillTree = new LinkedHashMap<>();
private final Map<Integer, SkillLearn> _nobleSkillTree = new ConcurrentHashMap<>();
private final Map<Integer, SkillLearn> _heroSkillTree = new ConcurrentHashMap<>();
private final Map<Integer, SkillLearn> _gameMasterSkillTree = new ConcurrentHashMap<>();
private final Map<Integer, SkillLearn> _gameMasterAuraSkillTree = new ConcurrentHashMap<>();
// Checker, sorted arrays of hash codes
private Map<Integer, int[]> _skillsByClassIdHashCodes; // Occupation skills

View File

@@ -25,7 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.instance.StaticObjectInstance;
import com.l2jmobius.gameserver.model.actor.templates.CreatureTemplate;
@@ -34,7 +34,7 @@ import com.l2jmobius.gameserver.model.actor.templates.CreatureTemplate;
* This class loads and holds all static object data.
* @author UnAfraid
*/
public final class StaticObjectData implements IGameXmlReader
public final class StaticObjectData implements IXmlReader
{
private final Map<Integer, StaticObjectInstance> _staticObjects = new HashMap<>();

View File

@@ -17,15 +17,15 @@
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.actor.transform.Transform;
@@ -39,9 +39,9 @@ import com.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
/**
* @author UnAfraid
*/
public final class TransformData implements IGameXmlReader
public final class TransformData implements IXmlReader
{
private final Map<Integer, Transform> _transformData = new HashMap<>();
private final Map<Integer, Transform> _transformData = new ConcurrentHashMap<>();
protected TransformData()
{

View File

@@ -26,14 +26,14 @@ import java.util.logging.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.ActionKey;
/**
* UI Data parser.
* @author Zoey76
*/
public class UIData implements IGameXmlReader
public class UIData implements IXmlReader
{
private static final Logger LOGGER = Logger.getLogger(UIData.class.getName());

View File

@@ -36,7 +36,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.instancemanager.DayNightSpawnManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -49,12 +49,12 @@ import com.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
* Spawn data retriever.
* @author Zoey76, Mobius
*/
public final class SpawnTable implements IGameXmlReader
public final class SpawnTable implements IXmlReader
{
private static final Logger LOGGER = Logger.getLogger(SpawnTable.class.getName());
private static final String OTHER_XML_FOLDER = "data/spawns/Others";
private static final Map<Integer, Set<Spawn>> _spawnTable = new ConcurrentHashMap<>();
private static final Map<Integer, String> _spawnTemplates = new HashMap<>();
private static final Map<Integer, String> _spawnTemplates = new ConcurrentHashMap<>();
private int _spanwCount = 0;
@Override

View File

@@ -17,12 +17,15 @@
package com.l2jmobius.gameserver.engines;
import java.io.File;
import java.util.LinkedList;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.file.filter.XMLFilter;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.engines.items.DocumentItem;
@@ -37,40 +40,36 @@ public class DocumentEngine
{
private static final Logger LOGGER = Logger.getLogger(DocumentEngine.class.getName());
private final List<File> _itemFiles = new LinkedList<>();
private final List<File> _skillFiles = new LinkedList<>();
public static DocumentEngine getInstance()
{
return SingletonHolder._instance;
}
private final List<File> _itemFiles = new ArrayList<>();
private final List<File> _skillFiles = new ArrayList<>();
private static int count = 0;
protected DocumentEngine()
{
hashFiles("data/stats/items", _itemFiles);
processDirectory("data/stats/items", _itemFiles);
if (Config.CUSTOM_ITEMS_LOAD)
{
hashFiles("data/stats/items/custom", _itemFiles);
processDirectory("data/stats/items/custom", _itemFiles);
}
hashFiles("data/stats/skills", _skillFiles);
processDirectory("data/stats/skills", _skillFiles);
if (Config.CUSTOM_SKILLS_LOAD)
{
hashFiles("data/stats/skills/custom", _skillFiles);
processDirectory("data/stats/skills/custom", _skillFiles);
}
}
private void hashFiles(String dirname, List<File> hash)
private void processDirectory(String dirName, List<File> list)
{
final File dir = new File(Config.DATAPACK_ROOT, dirname);
final File dir = new File(Config.DATAPACK_ROOT, dirName);
if (!dir.exists())
{
LOGGER.warning("Dir " + dir.getAbsolutePath() + " not exists");
LOGGER.warning("Dir " + dir.getAbsolutePath() + " does not exist.");
return;
}
final File[] files = dir.listFiles(new XMLFilter());
for (File f : files)
for (File file : files)
{
hash.add(f);
list.add(file);
}
}
@@ -88,18 +87,31 @@ public class DocumentEngine
public void loadAllSkills(Map<Integer, Skill> allSkills)
{
int count = 0;
final List<ScheduledFuture<?>> jobs = new CopyOnWriteArrayList<>();
for (File file : _skillFiles)
{
final List<Skill> s = loadSkills(file);
if (s == null)
jobs.add(ThreadPool.schedule(() ->
{
continue;
}
for (Skill skill : s)
final List<Skill> skills = loadSkills(file);
if (skills == null)
{
return;
}
for (Skill skill : skills)
{
allSkills.put(SkillData.getSkillHashCode(skill), skill);
count++;
}
}, 0));
}
while (!jobs.isEmpty())
{
for (ScheduledFuture<?> job : jobs)
{
allSkills.put(SkillData.getSkillHashCode(skill), skill);
count++;
if ((job == null) || job.isDone() || job.isCancelled())
{
jobs.remove(job);
}
}
}
LOGGER.info(getClass().getSimpleName() + ": Loaded " + count + " Skill templates from XML files.");
@@ -111,12 +123,26 @@ public class DocumentEngine
*/
public List<Item> loadItems()
{
final List<Item> list = new LinkedList<>();
for (File f : _itemFiles)
final List<ScheduledFuture<?>> jobs = new CopyOnWriteArrayList<>();
final List<Item> list = new CopyOnWriteArrayList<>();
for (File file : _itemFiles)
{
final DocumentItem document = new DocumentItem(f);
document.parse();
list.addAll(document.getItemList());
jobs.add(ThreadPool.schedule(() ->
{
final DocumentItem document = new DocumentItem(file);
document.parse();
list.addAll(document.getItemList());
}, 0));
}
while (!jobs.isEmpty())
{
for (ScheduledFuture<?> job : jobs)
{
if ((job == null) || job.isDone() || job.isCancelled())
{
jobs.remove(job);
}
}
}
return list;
}
@@ -125,4 +151,9 @@ public class DocumentEngine
{
protected static final DocumentEngine _instance = new DocumentEngine();
}
public static DocumentEngine getInstance()
{
return SingletonHolder._instance;
}
}

View File

@@ -62,7 +62,7 @@ public final class EffectHandler implements IHandler<Class<? extends AbstractEff
{
try
{
ScriptEngineManager.getInstance().executeEffectMasterHandler();
ScriptEngineManager.getInstance().executeScript(ScriptEngineManager.EFFECT_MASTER_HANDLER_FILE);
}
catch (Exception e)
{

View File

@@ -38,7 +38,7 @@ import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.enums.ManorMode;
import com.l2jmobius.gameserver.model.CropProcure;
@@ -56,7 +56,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
* Castle manor system.
* @author malyelfik
*/
public final class CastleManorManager implements IGameXmlReader, IStorable
public final class CastleManorManager implements IXmlReader, IStorable
{
// SQL queries
private static final String INSERT_PRODUCT = "INSERT INTO castle_manor_production VALUES (?, ?, ?, ?, ?, ?)";

View File

@@ -25,7 +25,7 @@ import org.w3c.dom.Document;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.data.xml.impl.FakePlayerData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
@@ -41,7 +41,7 @@ import com.l2jmobius.gameserver.network.serverpackets.CreatureSay;
/**
* @author Mobius
*/
public final class FakePlayerChatManager implements IGameXmlReader
public final class FakePlayerChatManager implements IXmlReader
{
private static Logger LOGGER = Logger.getLogger(FakePlayerChatManager.class.getName());
final List<FakePlayerChatHolder> MESSAGES = new ArrayList<>();

View File

@@ -29,7 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.WorldObject;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.instancezone.Instance;
@@ -38,7 +38,7 @@ import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
/**
* @author evill33t, GodKratos
*/
public final class InstanceManager implements IGameXmlReader
public final class InstanceManager implements IXmlReader
{
private static final Map<Integer, Instance> INSTANCES = new ConcurrentHashMap<>();
private final Map<Integer, InstanceWorld> _instanceWorlds = new ConcurrentHashMap<>();
@@ -46,7 +46,7 @@ public final class InstanceManager implements IGameXmlReader
// InstanceId Names
private static final Map<Integer, String> _instanceIdNames = new HashMap<>();
// Instance templates
private final Map<Integer, String> _instanceTemplates = new HashMap<>();
private final Map<Integer, String> _instanceTemplates = new ConcurrentHashMap<>();
private final Map<Integer, Map<Integer, Long>> _playerInstanceTimes = new ConcurrentHashMap<>();
// SQL Queries
private static final String ADD_INSTANCE_TIME = "INSERT INTO character_instance_time (charId,instanceId,time) values (?,?,?) ON DUPLICATE KEY UPDATE time=?";

View File

@@ -17,16 +17,16 @@
package com.l2jmobius.gameserver.instancemanager;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.SevenSigns;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.MapRegion;
@@ -48,9 +48,9 @@ import com.l2jmobius.gameserver.model.zone.type.RespawnZone;
* Map Region Manager.
* @author Nyaran
*/
public final class MapRegionManager implements IGameXmlReader
public final class MapRegionManager implements IXmlReader
{
private static final Map<String, MapRegion> _regions = new HashMap<>();
private static final Map<String, MapRegion> _regions = new ConcurrentHashMap<>();
private static final String defaultRespawn = "talking_island_town";
protected MapRegionManager()

View File

@@ -26,7 +26,7 @@ import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.datatables.ItemTable;
@@ -46,7 +46,7 @@ import com.l2jmobius.gameserver.util.Util;
* Sell Buffs Manager
* @author St3eT
*/
public final class SellBuffsManager implements IGameXmlReader
public final class SellBuffsManager implements IXmlReader
{
private static final Logger LOGGER = Logger.getLogger(SellBuffsManager.class.getName());
private static final List<Integer> ALLOWED_BUFFS = new ArrayList<>();

View File

@@ -27,7 +27,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.tasks.StartMovingTask;
@@ -47,7 +47,7 @@ import com.l2jmobius.gameserver.network.NpcStringId;
* This class manages walking monsters.
* @author GKR
*/
public final class WalkingManager implements IGameXmlReader
public final class WalkingManager implements IXmlReader
{
// Repeat style:
// -1 - no repeat

View File

@@ -26,6 +26,7 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.OptionalInt;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -33,7 +34,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.model.World;
import com.l2jmobius.gameserver.model.WorldObject;
import com.l2jmobius.gameserver.model.actor.Creature;
@@ -56,19 +57,19 @@ import com.l2jmobius.gameserver.model.zone.type.RespawnZone;
* This class manages the zones
* @author durgus
*/
public final class ZoneManager implements IGameXmlReader
public final class ZoneManager implements IXmlReader
{
private static final Logger LOGGER = Logger.getLogger(ZoneManager.class.getName());
private static final Map<String, AbstractZoneSettings> SETTINGS = new HashMap<>();
public static final int SHIFT_BY = 15;
public static final int OFFSET_X = Math.abs(World.MAP_MIN_X >> SHIFT_BY);
public static final int OFFSET_Y = Math.abs(World.MAP_MIN_Y >> SHIFT_BY);
private static final int SHIFT_BY = 15;
private static final int OFFSET_X = Math.abs(World.MAP_MIN_X >> SHIFT_BY);
private static final int OFFSET_Y = Math.abs(World.MAP_MIN_Y >> SHIFT_BY);
private final Map<Class<? extends ZoneType>, Map<Integer, ? extends ZoneType>> _classZones = new HashMap<>();
private final Map<String, NpcSpawnTerritory> _spawnTerritories = new HashMap<>();
private int _lastDynamicId = 300000;
private final Map<Class<? extends ZoneType>, ConcurrentHashMap<Integer, ? extends ZoneType>> _classZones = new ConcurrentHashMap<>();
private final Map<String, NpcSpawnTerritory> _spawnTerritories = new ConcurrentHashMap<>();
private volatile int _lastDynamicId = 300000;
private List<ItemInstance> _debugItems;
private final ZoneRegion[][] _zoneRegions = new ZoneRegion[(World.MAP_MAX_X >> SHIFT_BY) + OFFSET_X + 1][(World.MAP_MAX_Y >> SHIFT_BY) + OFFSET_Y + 1];
@@ -326,6 +327,7 @@ public final class ZoneManager implements IGameXmlReader
}
catch (Exception e)
{
e.printStackTrace();
LOGGER.warning(getClass().getSimpleName() + ": ZoneData: No such zone type: " + zoneType + " in file: " + f.getName());
continue;
}
@@ -361,7 +363,7 @@ public final class ZoneManager implements IGameXmlReader
}
if (checkId(zoneId))
{
LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previous definition.");
}
if ((zoneName != null) && !zoneName.isEmpty())
@@ -428,7 +430,7 @@ public final class ZoneManager implements IGameXmlReader
* @param id the id
* @return true, if successful
*/
public boolean checkId(int id)
private boolean checkId(int id)
{
for (Map<Integer, ? extends ZoneType> map : _classZones.values())
{
@@ -447,12 +449,12 @@ public final class ZoneManager implements IGameXmlReader
* @param zone the zone
*/
@SuppressWarnings("unchecked")
public <T extends ZoneType> void addZone(Integer id, T zone)
private <T extends ZoneType> void addZone(Integer id, T zone)
{
Map<Integer, T> map = (Map<Integer, T>) _classZones.get(zone.getClass());
ConcurrentHashMap<Integer, T> map = (ConcurrentHashMap<Integer, T>) _classZones.get(zone.getClass());
if (map == null)
{
map = new HashMap<>();
map = new ConcurrentHashMap<>();
map.put(id, zone);
_classZones.put(zone.getClass(), map);
}

View File

@@ -93,7 +93,11 @@ public class BossZone extends ZoneType
{
super(id);
_oustLoc = new int[3];
final AbstractZoneSettings settings = ZoneManager.getSettings(getName()) == null ? new Settings() : ZoneManager.getSettings(getName());
AbstractZoneSettings settings = ZoneManager.getSettings(getName());
if (settings == null)
{
settings = new Settings();
}
setSettings(settings);
GrandBossManager.getInstance().addZone(this);
}

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.model.actor.Creature;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.entity.Castle;
import com.l2jmobius.gameserver.model.stats.Stats;
import com.l2jmobius.gameserver.model.zone.AbstractZoneSettings;
import com.l2jmobius.gameserver.model.zone.TaskZoneSettings;
import com.l2jmobius.gameserver.model.zone.ZoneType;
@@ -59,7 +60,12 @@ public class DamageZone extends ZoneType
_castle = null;
setTargetType(InstanceType.Playable); // default only playabale
setSettings(ZoneManager.getSettings(getName()) == null ? new TaskZoneSettings() : ZoneManager.getSettings(getName()));
AbstractZoneSettings settings = ZoneManager.getSettings(getName());
if (settings == null)
{
settings = new TaskZoneSettings();
}
setSettings(settings);
}
@Override

View File

@@ -27,6 +27,7 @@ import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.actor.Creature;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.zone.AbstractZoneSettings;
import com.l2jmobius.gameserver.model.zone.TaskZoneSettings;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.model.zone.ZoneType;
@@ -54,7 +55,12 @@ public class EffectZone extends ZoneType
setTargetType(InstanceType.Playable); // default only playable
_bypassConditions = false;
_isShowDangerIcon = true;
setSettings(ZoneManager.getSettings(getName()) == null ? new TaskZoneSettings() : ZoneManager.getSettings(getName()));
AbstractZoneSettings settings = ZoneManager.getSettings(getName());
if (settings == null)
{
settings = new TaskZoneSettings();
}
setSettings(settings);
}
@Override

View File

@@ -51,7 +51,12 @@ public class OlympiadStadiumZone extends ZoneRespawn
public OlympiadStadiumZone(int id)
{
super(id);
setSettings(ZoneManager.getSettings(getName()) == null ? new Settings() : ZoneManager.getSettings(getName()));
AbstractZoneSettings settings = ZoneManager.getSettings(getName());
if (settings == null)
{
settings = new Settings();
}
setSettings(settings);
}
public final class Settings extends AbstractZoneSettings

View File

@@ -49,7 +49,12 @@ public class SiegeZone extends ZoneType
public SiegeZone(int id)
{
super(id);
setSettings(ZoneManager.getSettings(getName()) == null ? new Settings() : ZoneManager.getSettings(getName()));
AbstractZoneSettings settings = ZoneManager.getSettings(getName());
if (settings == null)
{
settings = new Settings();
}
setSettings(settings);
}
public final class Settings extends AbstractZoneSettings

View File

@@ -28,8 +28,6 @@ import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -42,22 +40,21 @@ import java.util.logging.Logger;
import org.w3c.dom.Document;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.gameserver.scripting.java.JavaScriptingEngine;
/**
* Caches script engines and provides functionality for executing and managing scripts.
* @author KenM, HorridoJoho
*/
public final class ScriptEngineManager implements IGameXmlReader
public final class ScriptEngineManager implements IXmlReader
{
private static final Logger LOGGER = Logger.getLogger(ScriptEngineManager.class.getName());
public static final Path SCRIPT_FOLDER = Paths.get(Config.DATAPACK_ROOT.getAbsolutePath(), "data", "scripts");
public static final Path MASTER_HANDLER_FILE = Paths.get(SCRIPT_FOLDER.toString(), "handlers", "MasterHandler.java");
public static final Path EFFECT_MASTER_HANDLER_FILE = Paths.get(SCRIPT_FOLDER.toString(), "handlers", "EffectMasterHandler.java");
private final Map<String, IExecutionContext> _extEngines = new HashMap<>();
private IExecutionContext _currentExecutionContext = null;
private IExecutionContext _javaExecutionContext = null;
static final List<String> _exclusions = new ArrayList<>();
protected ScriptEngineManager()
@@ -163,12 +160,7 @@ public final class ScriptEngineManager implements IGameXmlReader
private void registerEngine(IScriptingEngine engine, Properties props)
{
maybeSetProperties("language." + engine.getLanguageName() + ".", props, engine);
final IExecutionContext context = engine.createExecutionContext();
for (String commonExtension : engine.getCommonFileExtensions())
{
_extEngines.put(commonExtension, context);
}
_javaExecutionContext = engine.createExecutionContext();
LOGGER.info("ScriptEngine: " + engine.getEngineName() + " " + engine.getEngineVersion() + " (" + engine.getLanguageName() + " " + engine.getLanguageVersion() + ")");
}
@@ -197,51 +189,6 @@ public final class ScriptEngineManager implements IGameXmlReader
}
}
private IExecutionContext getEngineByExtension(String ext)
{
return _extEngines.get(ext);
}
private String getFileExtension(Path p)
{
final String name = p.getFileName().toString();
final int lastDotIdx = name.lastIndexOf('.');
if (lastDotIdx == -1)
{
return null;
}
final String extension = name.substring(lastDotIdx + 1);
if (extension.isEmpty())
{
return null;
}
return extension;
}
private void checkExistingFile(String messagePre, Path filePath) throws Exception
{
if (!Files.exists(filePath))
{
throw new Exception(messagePre + ": " + filePath + " does not exists!");
}
else if (!Files.isRegularFile(filePath))
{
throw new Exception(messagePre + ": " + filePath + " is not a file!");
}
}
public void executeMasterHandler() throws Exception
{
executeScript(MASTER_HANDLER_FILE);
}
public void executeEffectMasterHandler() throws Exception
{
executeScript(EFFECT_MASTER_HANDLER_FILE);
}
public void executeScriptList() throws Exception
{
if (Config.ALT_DEV_NO_QUESTS)
@@ -249,77 +196,35 @@ public final class ScriptEngineManager implements IGameXmlReader
return;
}
final Map<IExecutionContext, List<Path>> files = new LinkedHashMap<>();
final List<Path> files = new ArrayList<>();
processDirectory(SCRIPT_FOLDER.toFile(), files);
for (Entry<IExecutionContext, List<Path>> entry : files.entrySet())
{
_currentExecutionContext = entry.getKey();
try
{
final Map<Path, Throwable> invokationErrors = entry.getKey().executeScripts(entry.getValue());
for (Entry<Path, Throwable> entry2 : invokationErrors.entrySet())
final Map<Path, Throwable> invokationErrors = _javaExecutionContext.executeScripts(files);
for (Entry<Path, Throwable> entry : invokationErrors.entrySet())
{
LOGGER.log(Level.WARNING, "ScriptEngine: " + entry2.getKey() + " failed execution!", entry2.getValue());
}
}
finally
{
_currentExecutionContext = null;
}
LOGGER.log(Level.WARNING, "ScriptEngine: " + entry.getKey() + " failed execution!", entry.getValue());
}
}
private void processDirectory(File dir, Map<IExecutionContext, List<Path>> files)
private void processDirectory(File dir, List<Path> files)
{
for (File file : dir.listFiles())
{
if (file.isDirectory())
if (file.isFile())
{
final String fileName = file.getName();
if (fileName.endsWith(".java") && !_exclusions.contains(fileName))
{
files.add(file.toPath().toAbsolutePath());
}
}
else if (file.isDirectory())
{
processDirectory(file, files);
}
else
{
processFile(file, files);
}
}
}
private void processFile(File file, Map<IExecutionContext, List<Path>> files)
{
if (_exclusions.contains(file.getName()))
{
return;
}
Path sourceFile = file.toPath();
try
{
checkExistingFile("ScriptFile", sourceFile);
}
catch (Exception e)
{
LOGGER.warning(e.getMessage());
return;
}
sourceFile = sourceFile.toAbsolutePath();
final String ext = getFileExtension(sourceFile);
if (ext == null)
{
LOGGER.warning("ScriptFile: " + sourceFile + " does not have an extension to determine the script engine!");
return;
}
final IExecutionContext engine = getEngineByExtension(ext);
if (engine == null)
{
return;
}
files.computeIfAbsent(engine, k -> new LinkedList<>()).add(sourceFile);
}
public void executeScript(Path sourceFile) throws Exception
{
Objects.requireNonNull(sourceFile);
@@ -329,34 +234,19 @@ public final class ScriptEngineManager implements IGameXmlReader
sourceFile = SCRIPT_FOLDER.resolve(sourceFile);
}
// throws exception if not exists or not file
checkExistingFile("ScriptFile", sourceFile);
sourceFile = sourceFile.toAbsolutePath();
final String ext = getFileExtension(sourceFile);
Objects.requireNonNull(sourceFile, "ScriptFile: " + sourceFile + " does not have an extension to determine the script engine!");
final IExecutionContext engine = getEngineByExtension(ext);
Objects.requireNonNull(engine, "ScriptEngine: No engine registered for extension " + ext + "!");
_currentExecutionContext = engine;
try
final Entry<Path, Throwable> error = _javaExecutionContext.executeScript(sourceFile);
if (error != null)
{
final Entry<Path, Throwable> error = engine.executeScript(sourceFile);
if (error != null)
{
throw new Exception("ScriptEngine: " + error.getKey() + " failed execution!", error.getValue());
}
}
finally
{
_currentExecutionContext = null;
throw new Exception("ScriptEngine: " + error.getKey() + " failed execution!", error.getValue());
}
}
public Path getCurrentLoadingScript()
{
return _currentExecutionContext != null ? _currentExecutionContext.getCurrentExecutingScript() : null;
return _javaExecutionContext.getCurrentExecutingScript();
}
public static ScriptEngineManager getInstance()

View File

@@ -36,8 +36,8 @@ import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.IPSubnet;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.loginserver.network.gameserverpackets.ServerStatus;
@@ -45,7 +45,7 @@ import com.l2jmobius.loginserver.network.gameserverpackets.ServerStatus;
* The Class GameServerTable loads the game server names and initialize the game server tables.
* @author KenM, Zoey76
*/
public final class GameServerTable implements IGameXmlReader
public final class GameServerTable implements IXmlReader
{
private static final Logger LOGGER = Logger.getLogger(GameServerTable.class.getName());