|
@@ -14,11 +14,6 @@
|
|
*/
|
|
*/
|
|
package com.l2jserver;
|
|
package com.l2jserver;
|
|
|
|
|
|
-import gnu.trove.list.array.TIntArrayList;
|
|
|
|
-import gnu.trove.map.hash.TIntFloatHashMap;
|
|
|
|
-import gnu.trove.map.hash.TIntIntHashMap;
|
|
|
|
-import gnu.trove.map.hash.TIntObjectHashMap;
|
|
|
|
-
|
|
|
|
import java.io.BufferedReader;
|
|
import java.io.BufferedReader;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.FileInputStream;
|
|
import java.io.FileInputStream;
|
|
@@ -35,17 +30,17 @@ import java.net.InetAddress;
|
|
import java.net.UnknownHostException;
|
|
import java.net.UnknownHostException;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
import java.util.StringTokenizer;
|
|
import java.util.StringTokenizer;
|
|
import java.util.logging.Level;
|
|
import java.util.logging.Level;
|
|
import java.util.logging.Logger;
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
-import javax.xml.parsers.DocumentBuilderFactory;
|
|
|
|
-
|
|
|
|
-import org.w3c.dom.Document;
|
|
|
|
import org.w3c.dom.NamedNodeMap;
|
|
import org.w3c.dom.NamedNodeMap;
|
|
import org.w3c.dom.Node;
|
|
import org.w3c.dom.Node;
|
|
|
|
|
|
|
|
+import com.l2jserver.gameserver.engines.DocumentParser;
|
|
import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
|
|
import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
|
|
import com.l2jserver.gameserver.util.FloodProtectorConfig;
|
|
import com.l2jserver.gameserver.util.FloodProtectorConfig;
|
|
import com.l2jserver.util.L2Properties;
|
|
import com.l2jserver.util.L2Properties;
|
|
@@ -105,9 +100,9 @@ public final class Config
|
|
public static double RESPAWN_RESTORE_MP;
|
|
public static double RESPAWN_RESTORE_MP;
|
|
public static boolean ALT_GAME_TIREDNESS;
|
|
public static boolean ALT_GAME_TIREDNESS;
|
|
public static boolean ENABLE_MODIFY_SKILL_DURATION;
|
|
public static boolean ENABLE_MODIFY_SKILL_DURATION;
|
|
- public static TIntIntHashMap SKILL_DURATION_LIST;
|
|
|
|
|
|
+ public static Map<Integer, Integer> SKILL_DURATION_LIST;
|
|
public static boolean ENABLE_MODIFY_SKILL_REUSE;
|
|
public static boolean ENABLE_MODIFY_SKILL_REUSE;
|
|
- public static TIntIntHashMap SKILL_REUSE_LIST;
|
|
|
|
|
|
+ public static Map<Integer, Integer> SKILL_REUSE_LIST;
|
|
public static boolean AUTO_LEARN_SKILLS;
|
|
public static boolean AUTO_LEARN_SKILLS;
|
|
public static boolean AUTO_LEARN_FS_SKILLS;
|
|
public static boolean AUTO_LEARN_FS_SKILLS;
|
|
public static boolean AUTO_LOOT_HERBS;
|
|
public static boolean AUTO_LOOT_HERBS;
|
|
@@ -463,7 +458,7 @@ public final class Config
|
|
public static boolean ALLOW_DISCARDITEM;
|
|
public static boolean ALLOW_DISCARDITEM;
|
|
public static int AUTODESTROY_ITEM_AFTER;
|
|
public static int AUTODESTROY_ITEM_AFTER;
|
|
public static int HERB_AUTO_DESTROY_TIME;
|
|
public static int HERB_AUTO_DESTROY_TIME;
|
|
- public static TIntArrayList LIST_PROTECTED_ITEMS;
|
|
|
|
|
|
+ public static List<Integer> LIST_PROTECTED_ITEMS;
|
|
public static boolean DATABASE_CLEAN_UP;
|
|
public static boolean DATABASE_CLEAN_UP;
|
|
public static long CONNECTION_CLOSE_TIME;
|
|
public static long CONNECTION_CLOSE_TIME;
|
|
public static int CHAR_STORE_INTERVAL;
|
|
public static int CHAR_STORE_INTERVAL;
|
|
@@ -577,7 +572,7 @@ public final class Config
|
|
public static boolean ALT_OLY_LOG_FIGHTS;
|
|
public static boolean ALT_OLY_LOG_FIGHTS;
|
|
public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
|
|
public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
|
|
public static boolean ALT_OLY_ANNOUNCE_GAMES;
|
|
public static boolean ALT_OLY_ANNOUNCE_GAMES;
|
|
- public static TIntArrayList LIST_OLY_RESTRICTED_ITEMS;
|
|
|
|
|
|
+ public static List<Integer> LIST_OLY_RESTRICTED_ITEMS;
|
|
public static int ALT_OLY_ENCHANT_LIMIT;
|
|
public static int ALT_OLY_ENCHANT_LIMIT;
|
|
public static int ALT_OLY_WAIT_TIME;
|
|
public static int ALT_OLY_WAIT_TIME;
|
|
public static int ALT_MANOR_REFRESH_TIME;
|
|
public static int ALT_MANOR_REFRESH_TIME;
|
|
@@ -710,8 +705,8 @@ public final class Config
|
|
public static byte TVT_EVENT_MIN_LVL;
|
|
public static byte TVT_EVENT_MIN_LVL;
|
|
public static byte TVT_EVENT_MAX_LVL;
|
|
public static byte TVT_EVENT_MAX_LVL;
|
|
public static int TVT_EVENT_EFFECTS_REMOVAL;
|
|
public static int TVT_EVENT_EFFECTS_REMOVAL;
|
|
- public static TIntIntHashMap TVT_EVENT_FIGHTER_BUFFS;
|
|
|
|
- public static TIntIntHashMap TVT_EVENT_MAGE_BUFFS;
|
|
|
|
|
|
+ public static Map<Integer, Integer> TVT_EVENT_FIGHTER_BUFFS;
|
|
|
|
+ public static Map<Integer, Integer> TVT_EVENT_MAGE_BUFFS;
|
|
public static int TVT_EVENT_MAX_PARTICIPANTS_PER_IP;
|
|
public static int TVT_EVENT_MAX_PARTICIPANTS_PER_IP;
|
|
public static boolean TVT_ALLOW_VOICED_COMMAND;
|
|
public static boolean TVT_ALLOW_VOICED_COMMAND;
|
|
public static boolean L2JMOD_ALLOW_WEDDING;
|
|
public static boolean L2JMOD_ALLOW_WEDDING;
|
|
@@ -766,7 +761,7 @@ public final class Config
|
|
public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
|
|
public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
|
|
public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP;
|
|
public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP;
|
|
public static int L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
|
public static int L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
|
- public static TIntIntHashMap L2JMOD_DUALBOX_CHECK_WHITELIST;
|
|
|
|
|
|
+ public static Map<Integer, Integer> L2JMOD_DUALBOX_CHECK_WHITELIST;
|
|
public static boolean L2JMOD_ALLOW_CHANGE_PASSWORD;
|
|
public static boolean L2JMOD_ALLOW_CHANGE_PASSWORD;
|
|
|
|
|
|
// --------------------------------------------------
|
|
// --------------------------------------------------
|
|
@@ -783,18 +778,18 @@ public final class Config
|
|
public static boolean SHOW_CREST_WITHOUT_QUEST;
|
|
public static boolean SHOW_CREST_WITHOUT_QUEST;
|
|
public static boolean ENABLE_RANDOM_ENCHANT_EFFECT;
|
|
public static boolean ENABLE_RANDOM_ENCHANT_EFFECT;
|
|
public static int MIN_NPC_LVL_DMG_PENALTY;
|
|
public static int MIN_NPC_LVL_DMG_PENALTY;
|
|
- public static TIntFloatHashMap NPC_DMG_PENALTY;
|
|
|
|
- public static TIntFloatHashMap NPC_CRIT_DMG_PENALTY;
|
|
|
|
- public static TIntFloatHashMap NPC_SKILL_DMG_PENALTY;
|
|
|
|
|
|
+ public static Map<Integer, Float> NPC_DMG_PENALTY;
|
|
|
|
+ public static Map<Integer, Float> NPC_CRIT_DMG_PENALTY;
|
|
|
|
+ public static Map<Integer, Float> NPC_SKILL_DMG_PENALTY;
|
|
public static int MIN_NPC_LVL_MAGIC_PENALTY;
|
|
public static int MIN_NPC_LVL_MAGIC_PENALTY;
|
|
- public static TIntFloatHashMap NPC_SKILL_CHANCE_PENALTY;
|
|
|
|
|
|
+ public static Map<Integer, Float> NPC_SKILL_CHANCE_PENALTY;
|
|
public static int DECAY_TIME_TASK;
|
|
public static int DECAY_TIME_TASK;
|
|
public static int NPC_DECAY_TIME;
|
|
public static int NPC_DECAY_TIME;
|
|
public static int RAID_BOSS_DECAY_TIME;
|
|
public static int RAID_BOSS_DECAY_TIME;
|
|
public static int SPOILED_DECAY_TIME;
|
|
public static int SPOILED_DECAY_TIME;
|
|
public static boolean GUARD_ATTACK_AGGRO_MOB;
|
|
public static boolean GUARD_ATTACK_AGGRO_MOB;
|
|
public static boolean ALLOW_WYVERN_UPGRADER;
|
|
public static boolean ALLOW_WYVERN_UPGRADER;
|
|
- public static TIntArrayList LIST_PET_RENT_NPC;
|
|
|
|
|
|
+ public static List<Integer> LIST_PET_RENT_NPC;
|
|
public static double RAID_HP_REGEN_MULTIPLIER;
|
|
public static double RAID_HP_REGEN_MULTIPLIER;
|
|
public static double RAID_MP_REGEN_MULTIPLIER;
|
|
public static double RAID_MP_REGEN_MULTIPLIER;
|
|
public static double RAID_PDEFENCE_MULTIPLIER;
|
|
public static double RAID_PDEFENCE_MULTIPLIER;
|
|
@@ -802,7 +797,7 @@ public final class Config
|
|
public static double RAID_PATTACK_MULTIPLIER;
|
|
public static double RAID_PATTACK_MULTIPLIER;
|
|
public static double RAID_MATTACK_MULTIPLIER;
|
|
public static double RAID_MATTACK_MULTIPLIER;
|
|
public static double RAID_MINION_RESPAWN_TIMER;
|
|
public static double RAID_MINION_RESPAWN_TIMER;
|
|
- public static TIntIntHashMap MINIONS_RESPAWN_TIME;
|
|
|
|
|
|
+ public static Map<Integer, Integer> MINIONS_RESPAWN_TIME;
|
|
public static float RAID_MIN_RESPAWN_MULTIPLIER;
|
|
public static float RAID_MIN_RESPAWN_MULTIPLIER;
|
|
public static float RAID_MAX_RESPAWN_MULTIPLIER;
|
|
public static float RAID_MAX_RESPAWN_MULTIPLIER;
|
|
public static boolean RAID_DISABLE_CURSE;
|
|
public static boolean RAID_DISABLE_CURSE;
|
|
@@ -812,7 +807,7 @@ public final class Config
|
|
public static int INVENTORY_MAXIMUM_PET;
|
|
public static int INVENTORY_MAXIMUM_PET;
|
|
public static double PET_HP_REGEN_MULTIPLIER;
|
|
public static double PET_HP_REGEN_MULTIPLIER;
|
|
public static double PET_MP_REGEN_MULTIPLIER;
|
|
public static double PET_MP_REGEN_MULTIPLIER;
|
|
- public static TIntArrayList NON_TALKING_NPCS;
|
|
|
|
|
|
+ public static List<Integer> NON_TALKING_NPCS;
|
|
|
|
|
|
// --------------------------------------------------
|
|
// --------------------------------------------------
|
|
// PvP Settings
|
|
// PvP Settings
|
|
@@ -854,7 +849,7 @@ public final class Config
|
|
public static float RATE_QUEST_REWARD_SCROLL;
|
|
public static float RATE_QUEST_REWARD_SCROLL;
|
|
public static float RATE_QUEST_REWARD_RECIPE;
|
|
public static float RATE_QUEST_REWARD_RECIPE;
|
|
public static float RATE_QUEST_REWARD_MATERIAL;
|
|
public static float RATE_QUEST_REWARD_MATERIAL;
|
|
- public static TIntFloatHashMap RATE_DROP_ITEMS_ID;
|
|
|
|
|
|
+ public static Map<Integer, Float> RATE_DROP_ITEMS_ID;
|
|
public static float RATE_KARMA_EXP_LOST;
|
|
public static float RATE_KARMA_EXP_LOST;
|
|
public static float RATE_SIEGE_GUARDS_PRICE;
|
|
public static float RATE_SIEGE_GUARDS_PRICE;
|
|
public static float RATE_DROP_COMMON_HERBS;
|
|
public static float RATE_DROP_COMMON_HERBS;
|
|
@@ -923,7 +918,7 @@ public final class Config
|
|
public static boolean ACCEPT_ALTERNATE_ID;
|
|
public static boolean ACCEPT_ALTERNATE_ID;
|
|
public static int REQUEST_ID;
|
|
public static int REQUEST_ID;
|
|
public static boolean RESERVE_HOST_ON_LOGIN = false;
|
|
public static boolean RESERVE_HOST_ON_LOGIN = false;
|
|
- public static TIntArrayList PROTOCOL_LIST;
|
|
|
|
|
|
+ public static List<Integer> PROTOCOL_LIST;
|
|
public static boolean LOG_LOGIN_CONTROLLER;
|
|
public static boolean LOG_LOGIN_CONTROLLER;
|
|
public static boolean LOGIN_SERVER_SCHEDULE_RESTART;
|
|
public static boolean LOGIN_SERVER_SCHEDULE_RESTART;
|
|
public static long LOGIN_SERVER_SCHEDULE_RESTART_TIME;
|
|
public static long LOGIN_SERVER_SCHEDULE_RESTART_TIME;
|
|
@@ -970,8 +965,8 @@ public final class Config
|
|
public static boolean CHECK_KNOWN;
|
|
public static boolean CHECK_KNOWN;
|
|
public static int GAME_SERVER_LOGIN_PORT;
|
|
public static int GAME_SERVER_LOGIN_PORT;
|
|
public static String GAME_SERVER_LOGIN_HOST;
|
|
public static String GAME_SERVER_LOGIN_HOST;
|
|
- public static String[] GAME_SERVER_SUBNETS;
|
|
|
|
- public static String[] GAME_SERVER_HOSTS;
|
|
|
|
|
|
+ public static List<String> GAME_SERVER_SUBNETS;
|
|
|
|
+ public static List<String> GAME_SERVER_HOSTS;
|
|
public static int NEW_NODE_ID;
|
|
public static int NEW_NODE_ID;
|
|
public static int SELECTED_NODE_ID;
|
|
public static int SELECTED_NODE_ID;
|
|
public static int LINKED_NODE_ID;
|
|
public static int LINKED_NODE_ID;
|
|
@@ -1170,7 +1165,7 @@ public final class Config
|
|
MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
|
|
MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
|
|
|
|
|
|
String[] protocols = serverSettings.getProperty("AllowedProtocolRevisions", "267;268;271;273").split(";");
|
|
String[] protocols = serverSettings.getProperty("AllowedProtocolRevisions", "267;268;271;273").split(";");
|
|
- PROTOCOL_LIST = new TIntArrayList(protocols.length);
|
|
|
|
|
|
+ PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
|
for (String protocol : protocols)
|
|
for (String protocol : protocols)
|
|
{
|
|
{
|
|
try
|
|
try
|
|
@@ -1183,75 +1178,10 @@ public final class Config
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- File file = new File(IP_CONFIG_FILE);
|
|
|
|
- Document doc = null;
|
|
|
|
- ArrayList<String> subnets = new ArrayList<>(5);
|
|
|
|
- ArrayList<String> hosts = new ArrayList<>(5);
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
|
|
|
- factory.setValidating(false);
|
|
|
|
- factory.setIgnoringComments(true);
|
|
|
|
- doc = factory.newDocumentBuilder().parse(file);
|
|
|
|
- for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
|
|
|
- {
|
|
|
|
- NamedNodeMap attrs;
|
|
|
|
- Node att;
|
|
|
|
-
|
|
|
|
- if ("gameserver".equalsIgnoreCase(n.getNodeName()))
|
|
|
|
- {
|
|
|
|
- for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
|
|
|
- {
|
|
|
|
- if ("define".equalsIgnoreCase(d.getNodeName()))
|
|
|
|
- {
|
|
|
|
- attrs = d.getAttributes();
|
|
|
|
-
|
|
|
|
- att = attrs.getNamedItem("subnet");
|
|
|
|
- if (att == null)
|
|
|
|
- {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- subnets.add(att.getNodeValue());
|
|
|
|
-
|
|
|
|
- att = attrs.getNamedItem("address");
|
|
|
|
- if (att == null)
|
|
|
|
- {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- hosts.add(att.getNodeValue());
|
|
|
|
-
|
|
|
|
- if (hosts.size() != subnets.size())
|
|
|
|
- {
|
|
|
|
- _log.log(Level.WARNING, "Failed to Load " + IP_CONFIG_FILE + " File - subnets does not match server addresses.");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- attrs = n.getAttributes();
|
|
|
|
- att = attrs.getNamedItem("address");
|
|
|
|
- if (att == null)
|
|
|
|
- {
|
|
|
|
- _log.log(Level.WARNING, "Failed to load " + IP_CONFIG_FILE + " file - default server address is missing.");
|
|
|
|
- hosts.add("127.0.0.1");
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- hosts.add(att.getNodeValue());
|
|
|
|
- }
|
|
|
|
- subnets.add("0.0.0.0/0");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- GAME_SERVER_SUBNETS = subnets.toArray(new String[subnets.size()]);
|
|
|
|
- GAME_SERVER_HOSTS = hosts.toArray(new String[hosts.size()]);
|
|
|
|
- }
|
|
|
|
- catch (Exception e)
|
|
|
|
- {
|
|
|
|
- _log.log(Level.SEVERE, "Failed to load " + IP_CONFIG_FILE + " file!", e);
|
|
|
|
- GAME_SERVER_SUBNETS = new String[]{ "0.0.0.0/0" };
|
|
|
|
- GAME_SERVER_HOSTS = new String[]{ "127.0.0.1" };
|
|
|
|
- }
|
|
|
|
|
|
+ // Hosts and Subnets
|
|
|
|
+ IPConfigData ipcd = new IPConfigData();
|
|
|
|
+ GAME_SERVER_SUBNETS = ipcd.getSubnets();
|
|
|
|
+ GAME_SERVER_HOSTS = ipcd.getHosts();
|
|
|
|
|
|
// Load Community Properties file (if exists)
|
|
// Load Community Properties file (if exists)
|
|
L2Properties communityServerSettings = new L2Properties();
|
|
L2Properties communityServerSettings = new L2Properties();
|
|
@@ -1526,7 +1456,7 @@ public final class Config
|
|
if (ENABLE_MODIFY_SKILL_DURATION)
|
|
if (ENABLE_MODIFY_SKILL_DURATION)
|
|
{
|
|
{
|
|
String[] propertySplit = Character.getProperty("SkillDurationList", "").split(";");
|
|
String[] propertySplit = Character.getProperty("SkillDurationList", "").split(";");
|
|
- SKILL_DURATION_LIST = new TIntIntHashMap(propertySplit.length);
|
|
|
|
|
|
+ SKILL_DURATION_LIST = new HashMap<>(propertySplit.length);
|
|
for (String skill : propertySplit)
|
|
for (String skill : propertySplit)
|
|
{
|
|
{
|
|
String[] skillSplit = skill.split(",");
|
|
String[] skillSplit = skill.split(",");
|
|
@@ -1555,7 +1485,7 @@ public final class Config
|
|
if (ENABLE_MODIFY_SKILL_REUSE)
|
|
if (ENABLE_MODIFY_SKILL_REUSE)
|
|
{
|
|
{
|
|
String[] propertySplit = Character.getProperty("SkillReuseList", "").split(";");
|
|
String[] propertySplit = Character.getProperty("SkillReuseList", "").split(";");
|
|
- SKILL_REUSE_LIST = new TIntIntHashMap(propertySplit.length);
|
|
|
|
|
|
+ SKILL_REUSE_LIST = new HashMap<>(propertySplit.length);
|
|
for (String skill : propertySplit)
|
|
for (String skill : propertySplit)
|
|
{
|
|
{
|
|
String[] skillSplit = skill.split(",");
|
|
String[] skillSplit = skill.split(",");
|
|
@@ -1943,7 +1873,7 @@ public final class Config
|
|
AUTODESTROY_ITEM_AFTER = Integer.parseInt(General.getProperty("AutoDestroyDroppedItemAfter", "600"));
|
|
AUTODESTROY_ITEM_AFTER = Integer.parseInt(General.getProperty("AutoDestroyDroppedItemAfter", "600"));
|
|
HERB_AUTO_DESTROY_TIME = Integer.parseInt(General.getProperty("AutoDestroyHerbTime", "60")) * 1000;
|
|
HERB_AUTO_DESTROY_TIME = Integer.parseInt(General.getProperty("AutoDestroyHerbTime", "60")) * 1000;
|
|
String[] split = General.getProperty("ListOfProtectedItems", "0").split(",");
|
|
String[] split = General.getProperty("ListOfProtectedItems", "0").split(",");
|
|
- LIST_PROTECTED_ITEMS = new TIntArrayList(split.length);
|
|
|
|
|
|
+ LIST_PROTECTED_ITEMS = new ArrayList<>(split.length);
|
|
for (String id : split)
|
|
for (String id : split)
|
|
{
|
|
{
|
|
LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
|
|
LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
|
|
@@ -2197,10 +2127,10 @@ public final class Config
|
|
GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
|
|
GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
|
|
ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
|
|
ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
|
|
String[] listPetRentNpc = NPC.getProperty("ListPetRentNpc", "30827").split(",");
|
|
String[] listPetRentNpc = NPC.getProperty("ListPetRentNpc", "30827").split(",");
|
|
- LIST_PET_RENT_NPC = new TIntArrayList(listPetRentNpc.length);
|
|
|
|
|
|
+ LIST_PET_RENT_NPC = new ArrayList<>(listPetRentNpc.length);
|
|
for (String id : listPetRentNpc)
|
|
for (String id : listPetRentNpc)
|
|
{
|
|
{
|
|
- LIST_PET_RENT_NPC.add(Integer.parseInt(id));
|
|
|
|
|
|
+ LIST_PET_RENT_NPC.add(Integer.valueOf(id));
|
|
}
|
|
}
|
|
RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidHpRegenMultiplier", "100")) / 100;
|
|
RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidHpRegenMultiplier", "100")) / 100;
|
|
RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMpRegenMultiplier", "100")) / 100;
|
|
RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMpRegenMultiplier", "100")) / 100;
|
|
@@ -2212,7 +2142,7 @@ public final class Config
|
|
RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMaxRespawnMultiplier", "1.0"));
|
|
RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMaxRespawnMultiplier", "1.0"));
|
|
RAID_MINION_RESPAWN_TIMER = Integer.parseInt(NPC.getProperty("RaidMinionRespawnTime", "300000"));
|
|
RAID_MINION_RESPAWN_TIMER = Integer.parseInt(NPC.getProperty("RaidMinionRespawnTime", "300000"));
|
|
final String[] propertySplit = NPC.getProperty("CustomMinionsRespawnTime", "").split(";");
|
|
final String[] propertySplit = NPC.getProperty("CustomMinionsRespawnTime", "").split(";");
|
|
- MINIONS_RESPAWN_TIME = new TIntIntHashMap(propertySplit.length);
|
|
|
|
|
|
+ MINIONS_RESPAWN_TIME = new HashMap<>(propertySplit.length);
|
|
for (String prop : propertySplit)
|
|
for (String prop : propertySplit)
|
|
{
|
|
{
|
|
String[] propSplit = prop.split(",");
|
|
String[] propSplit = prop.split(",");
|
|
@@ -2223,7 +2153,7 @@ public final class Config
|
|
|
|
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- MINIONS_RESPAWN_TIME.put(Integer.parseInt(propSplit[0]), Integer.parseInt(propSplit[1]));
|
|
|
|
|
|
+ MINIONS_RESPAWN_TIME.put(Integer.valueOf(propSplit[0]), Integer.valueOf(propSplit[1]));
|
|
}
|
|
}
|
|
catch (NumberFormatException nfe)
|
|
catch (NumberFormatException nfe)
|
|
{
|
|
{
|
|
@@ -2242,7 +2172,7 @@ public final class Config
|
|
PET_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetHpRegenMultiplier", "100")) / 100;
|
|
PET_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetHpRegenMultiplier", "100")) / 100;
|
|
PET_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetMpRegenMultiplier", "100")) / 100;
|
|
PET_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetMpRegenMultiplier", "100")) / 100;
|
|
split = NPC.getProperty("NonTalkingNpcs", "18684,18685,18686,18687,18688,18689,18690,19691,18692,31557,31606,31671,31672,31673,31674,32026,32030,32031,32032,32306,32619,32620,32621").split(",");
|
|
split = NPC.getProperty("NonTalkingNpcs", "18684,18685,18686,18687,18688,18689,18690,19691,18692,31557,31606,31671,31672,31673,31674,32026,32030,32031,32032,32306,32619,32620,32621").split(",");
|
|
- NON_TALKING_NPCS = new TIntArrayList(split.length);
|
|
|
|
|
|
+ NON_TALKING_NPCS = new ArrayList<>(split.length);
|
|
for (String npcId : split)
|
|
for (String npcId : split)
|
|
{
|
|
{
|
|
try
|
|
try
|
|
@@ -2361,7 +2291,7 @@ public final class Config
|
|
}
|
|
}
|
|
|
|
|
|
String[] rateDropItemsById = RatesSettings.getProperty("RateDropItemsById", "").split(";");
|
|
String[] rateDropItemsById = RatesSettings.getProperty("RateDropItemsById", "").split(";");
|
|
- RATE_DROP_ITEMS_ID = new TIntFloatHashMap(rateDropItemsById.length);
|
|
|
|
|
|
+ RATE_DROP_ITEMS_ID = new HashMap<>(rateDropItemsById.length);
|
|
if (!rateDropItemsById[0].isEmpty())
|
|
if (!rateDropItemsById[0].isEmpty())
|
|
{
|
|
{
|
|
for (String item : rateDropItemsById)
|
|
for (String item : rateDropItemsById)
|
|
@@ -2375,7 +2305,7 @@ public final class Config
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- RATE_DROP_ITEMS_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
|
|
|
|
|
|
+ RATE_DROP_ITEMS_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
|
|
}
|
|
}
|
|
catch (NumberFormatException nfe)
|
|
catch (NumberFormatException nfe)
|
|
{
|
|
{
|
|
@@ -2586,7 +2516,7 @@ public final class Config
|
|
tvtNpcCoords = L2JModSettings.getProperty("TvTEventFighterBuffs", "").split(";");
|
|
tvtNpcCoords = L2JModSettings.getProperty("TvTEventFighterBuffs", "").split(";");
|
|
if (!tvtNpcCoords[0].isEmpty())
|
|
if (!tvtNpcCoords[0].isEmpty())
|
|
{
|
|
{
|
|
- TVT_EVENT_FIGHTER_BUFFS = new TIntIntHashMap(tvtNpcCoords.length);
|
|
|
|
|
|
+ TVT_EVENT_FIGHTER_BUFFS = new HashMap<>(tvtNpcCoords.length);
|
|
for (String skill : tvtNpcCoords)
|
|
for (String skill : tvtNpcCoords)
|
|
{
|
|
{
|
|
String[] skillSplit = skill.split(",");
|
|
String[] skillSplit = skill.split(",");
|
|
@@ -2614,7 +2544,7 @@ public final class Config
|
|
tvtNpcCoords = L2JModSettings.getProperty("TvTEventMageBuffs", "").split(";");
|
|
tvtNpcCoords = L2JModSettings.getProperty("TvTEventMageBuffs", "").split(";");
|
|
if (!tvtNpcCoords[0].isEmpty())
|
|
if (!tvtNpcCoords[0].isEmpty())
|
|
{
|
|
{
|
|
- TVT_EVENT_MAGE_BUFFS = new TIntIntHashMap(tvtNpcCoords.length);
|
|
|
|
|
|
+ TVT_EVENT_MAGE_BUFFS = new HashMap<>(tvtNpcCoords.length);
|
|
for (String skill : tvtNpcCoords)
|
|
for (String skill : tvtNpcCoords)
|
|
{
|
|
{
|
|
String[] skillSplit = skill.split(",");
|
|
String[] skillSplit = skill.split(",");
|
|
@@ -2719,7 +2649,7 @@ public final class Config
|
|
L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxOlympiadParticipantsPerIP", "0"));
|
|
L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxOlympiadParticipantsPerIP", "0"));
|
|
L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxL2EventParticipantsPerIP", "0"));
|
|
L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = Integer.parseInt(L2JModSettings.getProperty("DualboxCheckMaxL2EventParticipantsPerIP", "0"));
|
|
String[] dualboxCheckWhiteList = L2JModSettings.getProperty("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
|
|
String[] dualboxCheckWhiteList = L2JModSettings.getProperty("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
|
|
- L2JMOD_DUALBOX_CHECK_WHITELIST = new TIntIntHashMap(dualboxCheckWhiteList.length);
|
|
|
|
|
|
+ L2JMOD_DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
|
for (String entry : dualboxCheckWhiteList)
|
|
for (String entry : dualboxCheckWhiteList)
|
|
{
|
|
{
|
|
String[] entrySplit = entry.split(",");
|
|
String[] entrySplit = entry.split(",");
|
|
@@ -2839,7 +2769,7 @@ public final class Config
|
|
ALT_OLY_SHOW_MONTHLY_WINNERS = Boolean.parseBoolean(Olympiad.getProperty("AltOlyShowMonthlyWinners", "true"));
|
|
ALT_OLY_SHOW_MONTHLY_WINNERS = Boolean.parseBoolean(Olympiad.getProperty("AltOlyShowMonthlyWinners", "true"));
|
|
ALT_OLY_ANNOUNCE_GAMES = Boolean.parseBoolean(Olympiad.getProperty("AltOlyAnnounceGames", "true"));
|
|
ALT_OLY_ANNOUNCE_GAMES = Boolean.parseBoolean(Olympiad.getProperty("AltOlyAnnounceGames", "true"));
|
|
String[] olyRestrictedItems = Olympiad.getProperty("AltOlyRestrictedItems", "6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,9388,9389,9390,17049,17050,17051,17052,17053,17054,17055,17056,17057,17058,17059,17060,17061,20759,20775,20776,20777,20778,14774").split(",");
|
|
String[] olyRestrictedItems = Olympiad.getProperty("AltOlyRestrictedItems", "6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,9388,9389,9390,17049,17050,17051,17052,17053,17054,17055,17056,17057,17058,17059,17060,17061,20759,20775,20776,20777,20778,14774").split(",");
|
|
- LIST_OLY_RESTRICTED_ITEMS = new TIntArrayList(olyRestrictedItems.length);
|
|
|
|
|
|
+ LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>(olyRestrictedItems.length);
|
|
for (String id : olyRestrictedItems)
|
|
for (String id : olyRestrictedItems)
|
|
{
|
|
{
|
|
LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
|
|
LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
|
|
@@ -4205,15 +4135,15 @@ public final class Config
|
|
|
|
|
|
public static class ClassMasterSettings
|
|
public static class ClassMasterSettings
|
|
{
|
|
{
|
|
- private final TIntObjectHashMap<TIntIntHashMap> _claimItems;
|
|
|
|
- private final TIntObjectHashMap<TIntIntHashMap> _rewardItems;
|
|
|
|
- private final TIntObjectHashMap<Boolean> _allowedClassChange;
|
|
|
|
|
|
+ private final Map<Integer, Map<Integer, Integer>> _claimItems;
|
|
|
|
+ private final Map<Integer, Map<Integer, Integer>> _rewardItems;
|
|
|
|
+ private final Map<Integer, Boolean> _allowedClassChange;
|
|
|
|
|
|
public ClassMasterSettings(String _configLine)
|
|
public ClassMasterSettings(String _configLine)
|
|
{
|
|
{
|
|
- _claimItems = new TIntObjectHashMap<>(3);
|
|
|
|
- _rewardItems = new TIntObjectHashMap<>(3);
|
|
|
|
- _allowedClassChange = new TIntObjectHashMap<>(3);
|
|
|
|
|
|
+ _claimItems = new HashMap<>(3);
|
|
|
|
+ _rewardItems = new HashMap<>(3);
|
|
|
|
+ _allowedClassChange = new HashMap<>(3);
|
|
if (_configLine != null)
|
|
if (_configLine != null)
|
|
{
|
|
{
|
|
parseConfigLine(_configLine.trim());
|
|
parseConfigLine(_configLine.trim());
|
|
@@ -4231,7 +4161,7 @@ public final class Config
|
|
|
|
|
|
_allowedClassChange.put(job, true);
|
|
_allowedClassChange.put(job, true);
|
|
|
|
|
|
- TIntIntHashMap _items = new TIntIntHashMap();
|
|
|
|
|
|
+ Map<Integer, Integer> _items = new HashMap<>();
|
|
// parse items needed for class change
|
|
// parse items needed for class change
|
|
if (st.hasMoreTokens())
|
|
if (st.hasMoreTokens())
|
|
{
|
|
{
|
|
@@ -4248,7 +4178,7 @@ public final class Config
|
|
|
|
|
|
_claimItems.put(job, _items);
|
|
_claimItems.put(job, _items);
|
|
|
|
|
|
- _items = new TIntIntHashMap();
|
|
|
|
|
|
+ _items = new HashMap<>();
|
|
// parse gifts after class change
|
|
// parse gifts after class change
|
|
if (st.hasMoreTokens())
|
|
if (st.hasMoreTokens())
|
|
{
|
|
{
|
|
@@ -4281,7 +4211,7 @@ public final class Config
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
- public TIntIntHashMap getRewardItems(int job)
|
|
|
|
|
|
+ public Map<Integer, Integer> getRewardItems(int job)
|
|
{
|
|
{
|
|
if (_rewardItems.containsKey(job))
|
|
if (_rewardItems.containsKey(job))
|
|
{
|
|
{
|
|
@@ -4291,7 +4221,7 @@ public final class Config
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- public TIntIntHashMap getRequireItems(int job)
|
|
|
|
|
|
+ public Map<Integer, Integer> getRequireItems(int job)
|
|
{
|
|
{
|
|
if (_claimItems.containsKey(job))
|
|
if (_claimItems.containsKey(job))
|
|
{
|
|
{
|
|
@@ -4306,11 +4236,11 @@ public final class Config
|
|
* @param line the string line to parse
|
|
* @param line the string line to parse
|
|
* @return a parsed float map
|
|
* @return a parsed float map
|
|
*/
|
|
*/
|
|
- private static TIntFloatHashMap parseConfigLine(String line)
|
|
|
|
|
|
+ private static Map<Integer, Float> parseConfigLine(String line)
|
|
{
|
|
{
|
|
String[] propertySplit = line.split(",");
|
|
String[] propertySplit = line.split(",");
|
|
- TIntFloatHashMap ret = new TIntFloatHashMap(propertySplit.length);
|
|
|
|
- int i = 1;
|
|
|
|
|
|
+ Map<Integer, Float> ret = new HashMap<>(propertySplit.length);
|
|
|
|
+ int i = 0;
|
|
for (String value : propertySplit)
|
|
for (String value : propertySplit)
|
|
{
|
|
{
|
|
ret.put(i++, Float.parseFloat(value));
|
|
ret.put(i++, Float.parseFloat(value));
|
|
@@ -4369,4 +4299,77 @@ public final class Config
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private static class IPConfigData extends DocumentParser
|
|
|
|
+ {
|
|
|
|
+ private static final List<String> subnets = new ArrayList<>(5);
|
|
|
|
+ private static final List<String> hosts = new ArrayList<>(5);
|
|
|
|
+
|
|
|
|
+ public IPConfigData()
|
|
|
|
+ {
|
|
|
|
+ load();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void load()
|
|
|
|
+ {
|
|
|
|
+ parseFile(new File(IP_CONFIG_FILE));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ protected void parseDocument()
|
|
|
|
+ {
|
|
|
|
+ NamedNodeMap attrs;
|
|
|
|
+ for (Node n = getCurrentDocument().getFirstChild(); n != null; n = n.getNextSibling())
|
|
|
|
+ {
|
|
|
|
+ if ("gameserver".equalsIgnoreCase(n.getNodeName()))
|
|
|
|
+ {
|
|
|
|
+ for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
|
|
|
+ {
|
|
|
|
+ if ("define".equalsIgnoreCase(d.getNodeName()))
|
|
|
|
+ {
|
|
|
|
+ attrs = d.getAttributes();
|
|
|
|
+ subnets.add(attrs.getNamedItem("subnet").getNodeValue());
|
|
|
|
+ hosts.add(attrs.getNamedItem("address").getNodeValue());
|
|
|
|
+
|
|
|
|
+ if (hosts.size() != subnets.size())
|
|
|
|
+ {
|
|
|
|
+ _log.log(Level.WARNING, "Failed to Load " + IP_CONFIG_FILE + " File - subnets does not match server addresses.");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Node att = n.getAttributes().getNamedItem("address");
|
|
|
|
+ if (att == null)
|
|
|
|
+ {
|
|
|
|
+ _log.log(Level.WARNING, "Failed to load " + IP_CONFIG_FILE + " file - default server address is missing.");
|
|
|
|
+ hosts.add("127.0.0.1");
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ hosts.add(att.getNodeValue());
|
|
|
|
+ }
|
|
|
|
+ subnets.add("0.0.0.0/0");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected List<String> getSubnets()
|
|
|
|
+ {
|
|
|
|
+ if (subnets.isEmpty())
|
|
|
|
+ {
|
|
|
|
+ return Arrays.asList("0.0.0.0/0");
|
|
|
|
+ }
|
|
|
|
+ return subnets;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected List<String> getHosts()
|
|
|
|
+ {
|
|
|
|
+ if (hosts.isEmpty())
|
|
|
|
+ {
|
|
|
|
+ return Arrays.asList("127.0.0.1");
|
|
|
|
+ }
|
|
|
|
+ return hosts;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|