Updated IXmlReader to match newer branches.

This commit is contained in:
MobiusDev
2018-04-03 18:15:04 +00:00
parent 9f35fd7fe6
commit 81d82a90ac
54 changed files with 1050 additions and 830 deletions

View File

@@ -16,6 +16,7 @@
*/
package ai.npc.ForgeOfTheGods;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -26,7 +27,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.L2Spawn;
@@ -38,7 +39,7 @@ import com.l2jmobius.gameserver.model.actor.L2Npc;
* Tar Beetle zone spawn
* @author malyelfik
*/
public class TarBeetleSpawn implements IXmlReader
public class TarBeetleSpawn implements IGameXmlReader
{
private final List<SpawnZone> zones = new ArrayList<>();
private ScheduledFuture<?> spawnTask;
@@ -61,7 +62,7 @@ public class TarBeetleSpawn implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
int i = 0;
for (Node d = doc.getFirstChild(); d != null; d = d.getNextSibling())
@@ -97,11 +98,11 @@ public class TarBeetleSpawn implements IXmlReader
final Zone bannedZone = new Zone();
final int bMinZ = parseInteger(attrs, "minZ");
final int bMaxZ = parseInteger(attrs, "maxZ");
for (Node f = c.getFirstChild(); f != null; f = f.getNextSibling())
for (Node h = c.getFirstChild(); h != null; h = h.getNextSibling())
{
if (f.getNodeName().equals("point"))
if (h.getNodeName().equals("point"))
{
attrs = f.getAttributes();
attrs = h.getAttributes();
final int x = parseInteger(attrs, "x");
final int y = parseInteger(attrs, "y");
bannedZone.add(x, y, bMinZ, bMaxZ, 0);

View File

@@ -16,6 +16,7 @@
*/
package ai.npc.NpcBuffers;
import java.io.File;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@@ -26,13 +27,13 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
/**
* @author UnAfraid
*/
public class NpcBuffersData implements IXmlReader
public class NpcBuffersData implements IGameXmlReader
{
private final Map<Integer, NpcBufferData> _npcBuffers = new HashMap<>();
@@ -49,7 +50,7 @@ public class NpcBuffersData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
StatsSet set;
Node attr;

View File

@@ -16,6 +16,7 @@
*/
package hellbound;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
@@ -23,13 +24,13 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
/**
* Point data parser.
* @author Zoey76
*/
public final class HellboundPointData implements IXmlReader
public final class HellboundPointData implements IGameXmlReader
{
private final Map<Integer, int[]> _pointsInfo = new HashMap<>();
@@ -47,7 +48,7 @@ public final class HellboundPointData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package hellbound;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -25,7 +26,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.Location;
@@ -34,7 +35,7 @@ import com.l2jmobius.gameserver.model.Location;
* Hellbound Spawns parser.
* @author Zoey76
*/
public final class HellboundSpawns implements IXmlReader
public final class HellboundSpawns implements IGameXmlReader
{
private final List<L2Spawn> _spawns = new ArrayList<>();
private final Map<Integer, int[]> _spawnLevels = new HashMap<>();
@@ -54,7 +55,7 @@ public final class HellboundSpawns implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node node = doc.getFirstChild(); node != null; node = node.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package instances.FinalEmperialTomb;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -31,7 +32,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -74,7 +75,7 @@ import instances.AbstractInstance;
* Use proper zone spawn system.
* @author Gigiikun
*/
public final class FinalEmperialTomb extends AbstractInstance implements IXmlReader
public final class FinalEmperialTomb extends AbstractInstance implements IGameXmlReader
{
protected class FETWorld extends InstanceWorld
{
@@ -258,7 +259,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
final Node first = doc.getFirstChild();
if ((first != null) && "list".equalsIgnoreCase(first.getNodeName()))

View File

@@ -2813,7 +2813,7 @@
<node X="145760" Y="-47633" />
<node X="145415" Y="-47471" />
</zone>
<zone name="no_bookmark_rune_slow_1" type="ConditionZone" shape="NPoly" minZ="509" maxZ="09">
<zone name="no_bookmark_rune_slow_1" type="ConditionZone" shape="NPoly" minZ="509" maxZ="9">
<stat name="NoBookmark" val="true" />
<node X="13785" Y="-47663" />
<node X="14046" Y="-47854" />
@@ -2827,7 +2827,7 @@
<node X="14052" Y="-50447" />
<node X="13788" Y="-50647" />
</zone>
<zone name="no_bookmark_rune_damage_1" type="ConditionZone" shape="NPoly" minZ="509" maxZ="09">
<zone name="no_bookmark_rune_damage_1" type="ConditionZone" shape="NPoly" minZ="509" maxZ="9">
<stat name="NoBookmark" val="true" />
<node X="13785" Y="-47663" />
<node X="14046" Y="-47854" />

View File

@@ -52,9 +52,8 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.PropertiesParser;
import com.l2jmobius.gameserver.GameServer;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import com.l2jmobius.gameserver.model.Location;
@@ -3299,7 +3298,7 @@ public final class Config
return result;
}
private static class IPConfigData implements IXmlReader
private static class IPConfigData implements IGameXmlReader
{
private static final List<String> _subnets = new ArrayList<>(5);
private static final List<String> _hosts = new ArrayList<>(5);
@@ -3312,22 +3311,22 @@ public final class Config
@Override
public void load()
{
GameServer.printSection("Network Configuration");
if ((new File(IPCONFIG_FILE)).exists())
final File f = new File(IPCONFIG_FILE);
if (f.exists())
{
LOGGER.log(Level.INFO, "Using existing ipconfig.xml.");
LOGGER.info("Network Config: ipconfig.xml exists using manual configuration...");
parseFile(new File(IPCONFIG_FILE));
}
else
// Auto configuration...
{
LOGGER.log(Level.INFO, "Using automatic network configuration.");
LOGGER.info("Network Config: ipconfig.xml doesn't exists using automatic configuration...");
autoIpConfig();
}
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
NamedNodeMap attrs;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
@@ -3344,7 +3343,7 @@ public final class Config
if (_hosts.size() != _subnets.size())
{
LOGGER.log(Level.WARNING, "Failed to Load " + IPCONFIG_FILE + " File - subnets does not match server addresses.");
LOGGER.warning("Failed to Load " + IPCONFIG_FILE + " File - subnets does not match server addresses.");
}
}
}
@@ -3352,7 +3351,7 @@ public final class Config
final Node att = n.getAttributes().getNamedItem("address");
if (att == null)
{
LOGGER.log(Level.WARNING, "Failed to load " + IPCONFIG_FILE + " file - default server address is missing.");
LOGGER.warning("Failed to load " + IPCONFIG_FILE + " file - default server address is missing.");
_hosts.add("127.0.0.1");
}
else
@@ -3417,7 +3416,7 @@ public final class Config
{
_subnets.add(subnet);
_hosts.add(hostAddress);
LOGGER.log(Level.INFO, "Adding new subnet: " + subnet + " address: " + hostAddress);
LOGGER.info("Network Config: Adding new subnet: " + subnet + " address: " + hostAddress);
}
}
}
@@ -3425,23 +3424,31 @@ public final class Config
// External host and subnet
_hosts.add(externalIp);
_subnets.add("0.0.0.0/0");
LOGGER.log(Level.INFO, "Adding new subnet: 0.0.0.0/0 address: " + externalIp);
LOGGER.info("Network Config: Adding new subnet: 0.0.0.0/0 address: " + externalIp);
}
catch (SocketException e)
{
LOGGER.log(Level.INFO, "Configuration failed please manually configure ipconfig.xml", e);
LOGGER.log(Level.INFO, "Network Config: Configuration failed please configure manually using ipconfig.xml", e);
System.exit(0);
}
}
protected List<String> getSubnets()
{
return _subnets.isEmpty() ? Arrays.asList("0.0.0.0/0") : _subnets;
if (_subnets.isEmpty())
{
return Arrays.asList("0.0.0.0/0");
}
return _subnets;
}
protected List<String> getHosts()
{
return _hosts.isEmpty() ? Arrays.asList("127.0.0.1") : _hosts;
if (_hosts.isEmpty())
{
return Arrays.asList("127.0.0.1");
}
return _hosts;
}
}
}

View File

@@ -0,0 +1,118 @@
/*
* 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

@@ -45,8 +45,8 @@ import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.network.BaseSendablePacket;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.commons.util.crypt.NewCrypt;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -28,7 +29,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.L2AccessLevel;
import com.l2jmobius.gameserver.model.L2AdminCommandAccessRight;
import com.l2jmobius.gameserver.model.StatsSet;
@@ -41,7 +42,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
* Loads administrator access levels and commands.
* @author UnAfraid
*/
public final class AdminData implements IXmlReader
public final class AdminData implements IGameXmlReader
{
private final Map<Integer, L2AccessLevel> _accessLevels = new HashMap<>();
private final Map<String, L2AdminCommandAccessRight> _adminCommandAccessRights = new HashMap<>();
@@ -65,7 +66,7 @@ public final class AdminData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
NamedNodeMap attrs;
Node attr;

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
@@ -23,7 +24,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.L2ArmorSet;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
@@ -31,7 +32,7 @@ import com.l2jmobius.gameserver.model.holders.SkillHolder;
* Loads armor set bonuses.
* @author godson, Luno, UnAfraid
*/
public final class ArmorSetsData implements IXmlReader
public final class ArmorSetsData implements IGameXmlReader
{
private final Map<Integer, L2ArmorSet> _armorSets = new HashMap<>();
@@ -52,7 +53,7 @@ public final class ArmorSetsData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -32,7 +32,7 @@ import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.file.filter.NumericNameFilter;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.model.buylist.L2BuyList;
@@ -43,7 +43,7 @@ import com.l2jmobius.gameserver.model.items.L2Item;
* Loads buy lists for NPCs.
* @author NosBit
*/
public final class BuyListData implements IXmlReader
public final class BuyListData implements IGameXmlReader
{
private static final Logger LOGGER = Logger.getLogger(BuyListData.class.getName());

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -27,14 +28,14 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.enums.CategoryType;
/**
* Loads the category data with Class or NPC IDs.
* @author NosBit, xban1x
*/
public final class CategoryData implements IXmlReader
public final class CategoryData implements IGameXmlReader
{
private static final Logger LOGGER = Logger.getLogger(CategoryData.class.getName());
@@ -54,7 +55,7 @@ public final class CategoryData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node node = doc.getFirstChild(); node != null; node = node.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
@@ -23,7 +24,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.base.ClassId;
import com.l2jmobius.gameserver.model.base.ClassInfo;
@@ -31,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 IXmlReader
public final class ClassListData implements IGameXmlReader
{
private final Map<ClassId, ClassInfo> _classData = new HashMap<>();
@@ -52,7 +53,7 @@ public final class ClassListData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -28,7 +29,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.MapRegionManager;
import com.l2jmobius.gameserver.model.Location;
@@ -40,7 +41,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2DoorTemplate;
* Loads doors.
* @author JIV, GodKratos, UnAfraid
*/
public class DoorData implements IXmlReader
public class DoorData implements IGameXmlReader
{
private static final Map<String, Set<Integer>> _groups = new HashMap<>();
private final Map<Integer, L2DoorInstance> _doors = new HashMap<>();
@@ -62,7 +63,7 @@ public class DoorData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node a = doc.getFirstChild(); a != null; a = a.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
@@ -24,7 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.items.enchant.EnchantScroll;
import com.l2jmobius.gameserver.model.items.enchant.EnchantSupportItem;
@@ -34,7 +35,7 @@ import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
* Loads item enchant data.
* @author UnAfraid
*/
public class EnchantItemData implements IXmlReader
public class EnchantItemData implements IGameXmlReader
{
private final Map<Integer, EnchantScroll> _scrolls = new HashMap<>();
private final Map<Integer, EnchantSupportItem> _supports = new HashMap<>();
@@ -58,7 +59,7 @@ public class EnchantItemData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
StatsSet set;
Node att;

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
@@ -24,7 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.model.holders.RangeChanceHolder;
import com.l2jmobius.gameserver.model.items.L2Item;
@@ -36,7 +37,7 @@ import com.l2jmobius.gameserver.util.Util;
/**
* @author UnAfraid
*/
public final class EnchantItemGroupsData implements IXmlReader
public final class EnchantItemGroupsData implements IGameXmlReader
{
private final Map<String, EnchantItemGroup> _itemGroups = new HashMap<>();
private final Map<Integer, EnchantScrollGroup> _scrollGroups = new HashMap<>();
@@ -57,7 +58,7 @@ public final class EnchantItemGroupsData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.EnumMap;
@@ -25,7 +26,7 @@ import java.util.Map;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.enums.StatFunction;
import com.l2jmobius.gameserver.model.items.L2Item;
@@ -38,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 IXmlReader
public class EnchantItemHPBonusData implements IGameXmlReader
{
private final Map<CrystalType, List<Integer>> _armorHPBonuses = new EnumMap<>(CrystalType.class);
@@ -53,7 +54,7 @@ public class EnchantItemHPBonusData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
@@ -23,7 +24,7 @@ import java.util.logging.Level;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.options.EnchantOptions;
import com.l2jmobius.gameserver.util.Util;
@@ -31,7 +32,7 @@ import com.l2jmobius.gameserver.util.Util;
/**
* @author UnAfraid
*/
public class EnchantItemOptionsData implements IXmlReader
public class EnchantItemOptionsData implements IGameXmlReader
{
private final Map<Integer, Map<Integer, EnchantOptions>> _data = new HashMap<>();
@@ -48,7 +49,7 @@ public class EnchantItemOptionsData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
int counter = 0;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
@@ -25,7 +26,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.L2EnchantSkillGroup;
import com.l2jmobius.gameserver.model.L2EnchantSkillGroup.EnchantSkillHolder;
import com.l2jmobius.gameserver.model.L2EnchantSkillLearn;
@@ -37,7 +38,7 @@ import com.l2jmobius.gameserver.model.skills.Skill;
* This class holds the Enchant Groups information.
* @author Micr0
*/
public class EnchantSkillGroupsData implements IXmlReader
public class EnchantSkillGroupsData implements IGameXmlReader
{
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;
@@ -73,7 +74,7 @@ public class EnchantSkillGroupsData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
@@ -23,13 +24,13 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
/**
* This class holds the Experience points for each level for players and pets.
* @author mrTJO
*/
public final class ExperienceData implements IXmlReader
public final class ExperienceData implements IGameXmlReader
{
private final Map<Integer, Long> _expTable = new HashMap<>();
@@ -55,7 +56,7 @@ public final class ExperienceData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
final Node table = doc.getFirstChild();
final NamedNodeMap tableAttr = table.getAttributes();

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -25,7 +26,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.fishing.L2Fish;
@@ -33,7 +34,7 @@ import com.l2jmobius.gameserver.model.fishing.L2Fish;
* This class holds the Fish information.
* @author nonom
*/
public final class FishData implements IXmlReader
public final class FishData implements IGameXmlReader
{
private final Map<Integer, L2Fish> _fishNormal = new HashMap<>();
private final Map<Integer, L2Fish> _fishEasy = new HashMap<>();
@@ -58,7 +59,7 @@ public final class FishData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
@@ -23,7 +24,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.fishing.L2FishingMonster;
@@ -31,7 +32,7 @@ import com.l2jmobius.gameserver.model.fishing.L2FishingMonster;
* This class holds the Fishing Monsters information.
* @author nonom
*/
public final class FishingMonstersData implements IXmlReader
public final class FishingMonstersData implements IGameXmlReader
{
private final Map<Integer, L2FishingMonster> _fishingMonstersData = new HashMap<>();
@@ -52,7 +53,7 @@ public final class FishingMonstersData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
@@ -23,7 +24,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.fishing.L2FishingRod;
@@ -31,7 +32,7 @@ import com.l2jmobius.gameserver.model.fishing.L2FishingRod;
* This class holds the Fishing Rods information.
* @author nonom
*/
public final class FishingRodsData implements IXmlReader
public final class FishingRodsData implements IGameXmlReader
{
private final Map<Integer, L2FishingRod> _fishingRods = new HashMap<>();
@@ -52,7 +53,7 @@ public final class FishingRodsData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -25,7 +26,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.base.ClassId;
import com.l2jmobius.gameserver.model.items.L2Henna;
@@ -37,7 +38,7 @@ import com.l2jmobius.gameserver.model.items.L2Henna;
* Allowed classes to wear each henna.
* @author Zoey76
*/
public final class HennaData implements IXmlReader
public final class HennaData implements IGameXmlReader
{
private final Map<Integer, L2Henna> _hennaList = new HashMap<>();
@@ -58,7 +59,7 @@ public final class HennaData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,11 +16,13 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -28,7 +30,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
* This class load, holds and calculates the hit condition bonuses.
* @author Nik
*/
public final class HitConditionBonusData implements IXmlReader
public final class HitConditionBonusData implements IGameXmlReader
{
private int frontBonus = 0;
private int sideBonus = 0;
@@ -55,7 +57,7 @@ public final class HitConditionBonusData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node d = doc.getFirstChild().getFirstChild(); d != null; d = d.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -26,7 +27,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.base.ClassId;
import com.l2jmobius.gameserver.model.items.PcItemTemplate;
@@ -36,7 +37,7 @@ import com.l2jmobius.gameserver.model.items.PcItemTemplate;
* 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 IXmlReader
public final class InitialEquipmentData implements IGameXmlReader
{
private final Map<ClassId, List<PcItemTemplate>> _initialEquipmentList = new HashMap<>();
private static final String NORMAL = "data/stats/initialEquipment.xml";
@@ -59,7 +60,7 @@ public final class InitialEquipmentData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -25,7 +26,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.enums.MacroType;
import com.l2jmobius.gameserver.enums.ShortcutType;
import com.l2jmobius.gameserver.model.Macro;
@@ -41,7 +42,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ShortCutRegister;
* What shortcuts get each newly created character.
* @author Zoey76
*/
public final class InitialShortcutData implements IXmlReader
public final class InitialShortcutData implements IGameXmlReader
{
private final Map<ClassId, List<Shortcut>> _initialShortcutData = new HashMap<>();
private final List<Shortcut> _initialGlobalShortcutList = new ArrayList<>();
@@ -69,7 +70,7 @@ public final class InitialShortcutData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@@ -26,14 +27,14 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.ItemMallProduct;
import com.l2jmobius.gameserver.model.StatsSet;
/**
* @author Mobius
*/
public class ItemMallData implements IXmlReader
public class ItemMallData implements IGameXmlReader
{
private static final Logger _log = Logger.getLogger(ItemMallData.class.getName());
private final Map<Integer, ItemMallProduct> _mallList = new HashMap<>();
@@ -57,7 +58,7 @@ public class ItemMallData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
NamedNodeMap attrs;
Node att;

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
@@ -24,12 +25,12 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
/**
* @author UnAfraid
*/
public class KarmaData implements IXmlReader
public class KarmaData implements IGameXmlReader
{
private final Map<Integer, Double> _karmaTable = new HashMap<>();
@@ -47,7 +48,7 @@ public class KarmaData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -29,7 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.file.filter.NumericNameFilter;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -45,7 +45,7 @@ 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 IXmlReader
public final class MultisellData implements IGameXmlReader
{
private final Map<Integer, ListContainer> _entries = new HashMap<>();

View File

@@ -34,7 +34,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.enums.AISkillScope;
@@ -53,7 +53,7 @@ import com.l2jmobius.gameserver.util.Util;
* NPC data parser.
* @author NosBit
*/
public class NpcData implements IXmlReader
public class NpcData implements IGameXmlReader
{
private final Map<Integer, L2NpcTemplate> _npcs = new ConcurrentHashMap<>();
private final Map<String, Integer> _clans = new ConcurrentHashMap<>();
@@ -790,7 +790,7 @@ public class NpcData implements IXmlReader
* Once Spawn System gets reworked delete this class<br>
* @author Zealar
*/
private final class MinionData implements IXmlReader
private final class MinionData implements IGameXmlReader
{
public final Map<Integer, List<MinionHolder>> _tempMinions = new HashMap<>();
@@ -808,7 +808,7 @@ public class NpcData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node node = doc.getFirstChild(); node != null; node = node.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
@@ -24,7 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.options.Options;
import com.l2jmobius.gameserver.model.options.OptionsSkillHolder;
@@ -36,7 +37,7 @@ import com.l2jmobius.gameserver.model.stats.functions.FuncTemplate;
* Item Option data.
* @author UnAfraid
*/
public class OptionData implements IXmlReader
public class OptionData implements IGameXmlReader
{
private final Map<Integer, Options> _optionData = new HashMap<>();
@@ -54,7 +55,7 @@ public class OptionData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
@@ -23,7 +24,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.enums.MountType;
import com.l2jmobius.gameserver.model.L2PetData;
import com.l2jmobius.gameserver.model.L2PetLevelData;
@@ -34,7 +35,7 @@ import com.l2jmobius.gameserver.model.StatsSet;
* TODO: load and use all pet parameters.
* @author Zoey76 (rework)
*/
public final class PetDataTable implements IXmlReader
public final class PetDataTable implements IGameXmlReader
{
private final Map<Integer, L2PetData> _pets = new HashMap<>();
@@ -55,7 +56,7 @@ public final class PetDataTable implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
NamedNodeMap attrs;
for (Node d = doc.getFirstChild().getFirstChild(); d != null; d = d.getNextSibling())

View File

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

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -26,7 +27,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.templates.L2PcTemplate;
@@ -36,7 +37,7 @@ import com.l2jmobius.gameserver.model.base.ClassId;
* Loads player's base stats.
* @author Forsaiken, Zoey76, GKR
*/
public final class PlayerTemplateData implements IXmlReader
public final class PlayerTemplateData implements IGameXmlReader
{
private static final Logger LOGGER = Logger.getLogger(PlayerTemplateData.class.getName());
@@ -59,7 +60,7 @@ public final class PlayerTemplateData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
NamedNodeMap attrs;
int classId = 0;

View File

@@ -16,19 +16,20 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.Arrays;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
/**
* This class holds the Player Xp Percent Lost Data for each level for players.
* @author Zealar
*/
public final class PlayerXpPercentLostData implements IXmlReader
public final class PlayerXpPercentLostData implements IGameXmlReader
{
private final int _maxlevel = ExperienceData.getInstance().getMaxLevel();
private final double[] _playerXpPercentLost = new double[_maxlevel + 1];
@@ -46,7 +47,7 @@ public final class PlayerXpPercentLostData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -25,7 +26,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.L2RecipeInstance;
import com.l2jmobius.gameserver.model.L2RecipeList;
import com.l2jmobius.gameserver.model.L2RecipeStatInstance;
@@ -36,7 +37,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
* The Class RecipeData.
* @author Zoey76
*/
public class RecipeData implements IXmlReader
public class RecipeData implements IGameXmlReader
{
private final Map<Integer, L2RecipeList> _recipes = new HashMap<>();
@@ -57,7 +58,7 @@ public class RecipeData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
// TODO: Cleanup checks enforced by XSD.
final List<L2RecipeInstance> recipePartList = new ArrayList<>();

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.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
/**
* Secondary Auth data.
* @author NosBit
*/
public class SecondaryAuthData implements IXmlReader
public class SecondaryAuthData implements IGameXmlReader
{
private final Set<String> _forbiddenPasswords = new HashSet<>();
private boolean _enabled = false;
@@ -52,7 +52,7 @@ public class SecondaryAuthData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
try
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
@@ -25,7 +26,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.SiegeScheduleDate;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.util.Util;
@@ -33,7 +34,7 @@ import com.l2jmobius.gameserver.util.Util;
/**
* @author UnAfraid
*/
public class SiegeScheduleData implements IXmlReader
public class SiegeScheduleData implements IGameXmlReader
{
private final List<SiegeScheduleDate> _scheduleData = new ArrayList<>();
@@ -56,7 +57,7 @@ public class SiegeScheduleData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -24,14 +25,14 @@ import java.util.Map;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.base.ClassId;
/**
* Holds all skill learn data for all NPCs.
* @author xban1x
*/
public final class SkillLearnData implements IXmlReader
public final class SkillLearnData implements IGameXmlReader
{
private final Map<Integer, List<ClassId>> _skillLearn = new HashMap<>();
@@ -49,7 +50,7 @@ public final class SkillLearnData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node node = doc.getFirstChild(); node != null; node = node.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -32,7 +33,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -72,7 +73,7 @@ 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 IXmlReader
public final class SkillTreesData implements IGameXmlReader
{
// ClassId, Map of Skill Hash Code, L2SkillLearn
private final Map<ClassId, Map<Integer, L2SkillLearn>> _classSkillTrees = new LinkedHashMap<>();
@@ -142,7 +143,7 @@ public final class SkillTreesData implements IXmlReader
* Parse a skill tree file and store it into the correct skill tree.
*/
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
int cId = -1;
ClassId classId = null;

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@@ -24,7 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance;
import com.l2jmobius.gameserver.model.actor.templates.L2CharTemplate;
@@ -33,7 +34,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2CharTemplate;
* This class loads and holds all static object data.
* @author UnAfraid
*/
public final class StaticObjectData implements IXmlReader
public final class StaticObjectData implements IGameXmlReader
{
private final Map<Integer, L2StaticObjectInstance> _staticObjects = new HashMap<>();
@@ -54,7 +55,7 @@ public final class StaticObjectData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
@@ -24,7 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.transform.Transform;
@@ -38,7 +39,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
/**
* @author UnAfraid
*/
public final class TransformData implements IXmlReader
public final class TransformData implements IGameXmlReader
{
private final Map<Integer, Transform> _transformData = new HashMap<>();
@@ -56,7 +57,7 @@ public final class TransformData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.data.xml.impl;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -25,14 +26,14 @@ import java.util.logging.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.ActionKey;
/**
* UI Data parser.
* @author Zoey76
*/
public class UIData implements IXmlReader
public class UIData implements IGameXmlReader
{
private static final Logger LOGGER = Logger.getLogger(UIData.class.getName());
@@ -54,7 +55,7 @@ public class UIData implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.datatables;
import java.io.File;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -35,7 +36,7 @@ import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.instancemanager.DayNightSpawnManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -47,7 +48,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
* Spawn data retriever.
* @author Zoey76
*/
public final class SpawnTable implements IXmlReader
public final class SpawnTable implements IGameXmlReader
{
private static final Logger LOGGER = Logger.getLogger(SpawnTable.class.getName());
// SQL
@@ -105,7 +106,7 @@ public final class SpawnTable implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
NamedNodeMap attrs;
for (Node list = doc.getFirstChild(); list != null; list = list.getNextSibling())

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.instancemanager;
import java.io.File;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -37,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.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.enums.ManorMode;
import com.l2jmobius.gameserver.model.CropProcure;
@@ -55,7 +56,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
* Castle manor system.
* @author malyelfik
*/
public final class CastleManorManager implements IXmlReader, IStorable
public final class CastleManorManager implements IGameXmlReader, IStorable
{
// SQL queries
private static final String INSERT_PRODUCT = "INSERT INTO castle_manor_production VALUES (?, ?, ?, ?, ?, ?)";
@@ -119,7 +120,7 @@ public final class CastleManorManager implements IXmlReader, IStorable
}
@Override
public final void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
StatsSet set;
NamedNodeMap attrs;

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.instancemanager;
import java.io.File;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -28,7 +29,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Instance;
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
@@ -36,7 +37,7 @@ import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
/**
* @author evill33t, GodKratos
*/
public final class InstanceManager implements IXmlReader
public final class InstanceManager implements IGameXmlReader
{
private static final Map<Integer, Instance> INSTANCES = new ConcurrentHashMap<>();
private final Map<Integer, InstanceWorld> _instanceWorlds = new ConcurrentHashMap<>();
@@ -198,7 +199,7 @@ public final class InstanceManager implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.instancemanager;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -24,7 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.SevenSigns;
import com.l2jmobius.gameserver.model.L2MapRegion;
import com.l2jmobius.gameserver.model.L2Object;
@@ -46,7 +47,7 @@ import com.l2jmobius.gameserver.model.zone.type.L2RespawnZone;
* Map Region Manager.
* @author Nyaran
*/
public final class MapRegionManager implements IXmlReader
public final class MapRegionManager implements IGameXmlReader
{
private static final Map<String, L2MapRegion> _regions = new HashMap<>();
private static final String defaultRespawn = "talking_island_town";
@@ -65,7 +66,7 @@ public final class MapRegionManager implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
NamedNodeMap attrs;
String name;

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.instancemanager;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -26,7 +27,7 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.tasks.StartMovingTask;
@@ -46,7 +47,7 @@ import com.l2jmobius.gameserver.network.NpcStringId;
* This class manages walking monsters.
* @author GKR
*/
public final class WalkingManager implements IXmlReader
public final class WalkingManager implements IGameXmlReader
{
// Repeat style:
// -1 - no repeat
@@ -77,7 +78,7 @@ public final class WalkingManager implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
for (Node d = doc.getFirstChild().getFirstChild(); d != null; d = d.getNextSibling())
{

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.IXmlReader;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.L2WorldRegion;
@@ -51,7 +51,7 @@ import com.l2jmobius.gameserver.model.zone.type.NpcSpawnTerritory;
* This class manages the zones
* @author durgus
*/
public final class ZoneManager implements IXmlReader
public final class ZoneManager implements IGameXmlReader
{
private static final Map<String, AbstractZoneSettings> _settings = new HashMap<>();

View File

@@ -34,8 +34,8 @@ import java.util.logging.Level;
import com.l2jmobius.Config;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.enums.CategoryType;

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.loginserver;
import java.io.File;
import java.math.BigInteger;
import java.net.InetAddress;
import java.net.UnknownHostException;
@@ -29,13 +30,14 @@ import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;
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;
@@ -43,8 +45,10 @@ 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 IXmlReader
public final class GameServerTable implements IGameXmlReader
{
private static final Logger LOGGER = Logger.getLogger(GameServerTable.class.getName());
// Server Names
private static final Map<Integer, String> SERVER_NAMES = new HashMap<>();
// Game Server Table
@@ -76,7 +80,7 @@ public final class GameServerTable implements IXmlReader
}
@Override
public void parseDocument(Document doc)
public void parseDocument(Document doc, File f)
{
final NodeList servers = doc.getElementsByTagName("server");
for (int s = 0; s < servers.getLength(); s++)
@@ -277,7 +281,11 @@ public final class GameServerTable implements IXmlReader
*/
private String hexToString(byte[] hex)
{
return hex == null ? "null" : new BigInteger(hex).toString(16);
if (hex == null)
{
return "null";
}
return new BigInteger(hex).toString(16);
}
/**
@@ -454,7 +462,11 @@ public final class GameServerTable implements IXmlReader
*/
public int getCurrentPlayerCount()
{
return _gst == null ? 0 : _gst.getPlayerCount();
if (_gst == null)
{
return 0;
}
return _gst.getPlayerCount();
}
/**