Code review Part 3.
This commit is contained in:
@ -2164,7 +2164,7 @@ public class Config
|
||||
|
||||
try
|
||||
{
|
||||
MINIONS_RESPAWN_TIME.put(Integer.valueOf(propSplit[0]), Integer.valueOf(propSplit[1]));
|
||||
MINIONS_RESPAWN_TIME.put(Integer.parseInt(propSplit[0]), Integer.parseInt(propSplit[1]));
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
@ -2281,7 +2281,7 @@ public class Config
|
||||
{
|
||||
try
|
||||
{
|
||||
RATE_DROP_AMOUNT_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
|
||||
RATE_DROP_AMOUNT_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
@ -2309,7 +2309,7 @@ public class Config
|
||||
{
|
||||
try
|
||||
{
|
||||
RATE_DROP_CHANCE_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
|
||||
RATE_DROP_CHANCE_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
@ -3180,7 +3180,7 @@ public class Config
|
||||
final PropertiesParser FactionSystem = new PropertiesParser(CUSTOM_FACTION_SYSTEM_CONFIG_FILE);
|
||||
|
||||
String[] tempString;
|
||||
FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false));
|
||||
FACTION_SYSTEM_ENABLED = FactionSystem.getBoolean("EnableFactionSystem", false);
|
||||
tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(",");
|
||||
FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]));
|
||||
tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(",");
|
||||
@ -3202,16 +3202,16 @@ public class Config
|
||||
|
||||
// Load FakePlayers config file (if exists)
|
||||
final PropertiesParser FakePlayers = new PropertiesParser(CUSTOM_FAKE_PLAYERS_CONFIG_FILE);
|
||||
FAKE_PLAYERS_ENABLED = Boolean.valueOf(FakePlayers.getBoolean("EnableFakePlayers", false));
|
||||
FAKE_PLAYER_CHAT = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerChat", false));
|
||||
FAKE_PLAYER_USE_SHOTS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerUseShots", false));
|
||||
FAKE_PLAYER_KILL_PVP = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerKillsRewardPvP", false));
|
||||
FAKE_PLAYER_KILL_KARMA = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerUnflaggedKillsKarma", false));
|
||||
FAKE_PLAYER_AGGRO_MONSTERS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerAggroMonsters", false));
|
||||
FAKE_PLAYER_AGGRO_PLAYERS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerAggroPlayers", false));
|
||||
FAKE_PLAYER_AGGRO_FPC = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerAggroFPC", false));
|
||||
FAKE_PLAYER_CAN_DROP_ITEMS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerCanDropItems", false));
|
||||
FAKE_PLAYER_CAN_PICKUP = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerCanPickup", false));
|
||||
FAKE_PLAYERS_ENABLED = FakePlayers.getBoolean("EnableFakePlayers", false);
|
||||
FAKE_PLAYER_CHAT = FakePlayers.getBoolean("FakePlayerChat", false);
|
||||
FAKE_PLAYER_USE_SHOTS = FakePlayers.getBoolean("FakePlayerUseShots", false);
|
||||
FAKE_PLAYER_KILL_PVP = FakePlayers.getBoolean("FakePlayerKillsRewardPvP", false);
|
||||
FAKE_PLAYER_KILL_KARMA = FakePlayers.getBoolean("FakePlayerUnflaggedKillsKarma", false);
|
||||
FAKE_PLAYER_AGGRO_MONSTERS = FakePlayers.getBoolean("FakePlayerAggroMonsters", false);
|
||||
FAKE_PLAYER_AGGRO_PLAYERS = FakePlayers.getBoolean("FakePlayerAggroPlayers", false);
|
||||
FAKE_PLAYER_AGGRO_FPC = FakePlayers.getBoolean("FakePlayerAggroFPC", false);
|
||||
FAKE_PLAYER_CAN_DROP_ITEMS = FakePlayers.getBoolean("FakePlayerCanDropItems", false);
|
||||
FAKE_PLAYER_CAN_PICKUP = FakePlayers.getBoolean("FakePlayerCanPickup", false);
|
||||
|
||||
// Load FindPvP config file (if exists)
|
||||
final PropertiesParser FindPvP = new PropertiesParser(CUSTOM_FIND_PVP_CONFIG_FILE);
|
||||
@ -3312,7 +3312,7 @@ public class Config
|
||||
{
|
||||
try
|
||||
{
|
||||
PREMIUM_RATE_DROP_CHANCE_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
|
||||
PREMIUM_RATE_DROP_CHANCE_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
@ -3339,7 +3339,7 @@ public class Config
|
||||
{
|
||||
try
|
||||
{
|
||||
PREMIUM_RATE_DROP_AMOUNT_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
|
||||
PREMIUM_RATE_DROP_AMOUNT_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
@ -3416,7 +3416,7 @@ public class Config
|
||||
MOBS_LIST_NOT_RANDOM = new ArrayList<>(mobsIds.length);
|
||||
for (String id : mobsIds)
|
||||
{
|
||||
MOBS_LIST_NOT_RANDOM.add(Integer.valueOf(id));
|
||||
MOBS_LIST_NOT_RANDOM.add(Integer.parseInt(id));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||
*/
|
||||
public class NetworkManager
|
||||
{
|
||||
private final Logger LOGGER = Logger.getLogger(getClass().getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(NetworkManager.class.getName());
|
||||
|
||||
private final ServerBootstrap _serverBootstrap;
|
||||
private final String _host;
|
||||
|
@ -33,7 +33,7 @@ import org.l2jmobius.Config;
|
||||
*/
|
||||
public class DeadLockDetector extends Thread
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(DeadLockDetector.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(DeadLockDetector.class.getName());
|
||||
|
||||
private final Duration _checkInterval;
|
||||
private final Runnable _deadLockCallback;
|
||||
|
@ -104,12 +104,10 @@ public interface IXmlReader
|
||||
catch (SAXParseException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Could not parse file: " + f.getName() + " at line: " + e.getLineNumber() + ", column: " + e.getColumnNumber() + " :", e);
|
||||
return;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Could not parse file: " + f.getName(), e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,10 +176,7 @@ public interface IXmlReader
|
||||
}
|
||||
else if (getCurrentFileFilter().accept(file))
|
||||
{
|
||||
jobs.add(ThreadPool.schedule(() ->
|
||||
{
|
||||
parseFile(file);
|
||||
}, 0));
|
||||
jobs.add(ThreadPool.schedule(() -> parseFile(file), 0));
|
||||
}
|
||||
}
|
||||
while (!jobs.isEmpty())
|
||||
|
@ -24,7 +24,7 @@ import java.util.logging.Logger;
|
||||
|
||||
public class ScrambledKeyPair
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(ScrambledKeyPair.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(ScrambledKeyPair.class.getName());
|
||||
private final KeyPair _pair;
|
||||
private final byte[] _scrambledModulus;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||
*/
|
||||
public class FortUpdater implements Runnable
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(FortUpdater.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(FortUpdater.class.getName());
|
||||
private final Clan _clan;
|
||||
private final Fort _fort;
|
||||
private int _runCount;
|
||||
|
@ -32,7 +32,7 @@ import org.l2jmobius.gameserver.communitybbs.Manager.PostBBSManager;
|
||||
*/
|
||||
public class Post
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(Post.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(Post.class.getName());
|
||||
|
||||
public static class CPost
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
|
||||
public class ForumsBBSManager extends BaseBBSManager
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(ForumsBBSManager.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(ForumsBBSManager.class.getName());
|
||||
private final Collection<Forum> _table;
|
||||
private int _lastid = 1;
|
||||
|
||||
|
@ -40,7 +40,7 @@ import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
*/
|
||||
public class AnnouncementsTable
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(AnnouncementsTable.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(AnnouncementsTable.class.getName());
|
||||
|
||||
private final Map<Integer, IAnnouncement> _announcements = new ConcurrentSkipListMap<>();
|
||||
|
||||
|
@ -37,7 +37,7 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
*/
|
||||
public class CharNameTable
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(CharNameTable.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(CharNameTable.class.getName());
|
||||
|
||||
private final Map<Integer, String> _chars = new ConcurrentHashMap<>();
|
||||
private final Map<Integer, Integer> _accessLevels = new ConcurrentHashMap<>();
|
||||
|
@ -198,7 +198,7 @@ public class ClanTable
|
||||
player.setPledgeClass(ClanMember.calculatePledgeClass(player));
|
||||
player.setClanPrivileges(new EnumIntBitmask<>(ClanPrivilege.class, true));
|
||||
|
||||
_clans.put(Integer.valueOf(clan.getId()), clan);
|
||||
_clans.put(clan.getId(), clan);
|
||||
|
||||
// should be update packet only
|
||||
player.sendPacket(new PledgeShowInfoUpdate(clan));
|
||||
|
@ -40,7 +40,7 @@ import org.l2jmobius.gameserver.network.GameClient;
|
||||
|
||||
public class OfflineTradersTable
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(OfflineTradersTable.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(OfflineTradersTable.class.getName());
|
||||
|
||||
// SQL DEFINITIONS
|
||||
private static final String SAVE_OFFLINE_STATUS = "INSERT INTO character_offline_trade (`charId`,`time`,`type`,`title`) VALUES (?,?,?,?)";
|
||||
|
@ -32,7 +32,7 @@ import org.l2jmobius.gameserver.data.xml.impl.PetDataTable;
|
||||
|
||||
public class PetNameTable
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(PetNameTable.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(PetNameTable.class.getName());
|
||||
|
||||
public static PetNameTable getInstance()
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ import org.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
*/
|
||||
public class AttendanceRewardData implements IXmlReader
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(AttendanceRewardData.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(AttendanceRewardData.class.getName());
|
||||
private final List<ItemHolder> _rewards = new ArrayList<>();
|
||||
private int _rewardsCount = 0;
|
||||
|
||||
|
@ -34,7 +34,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
|
||||
*/
|
||||
public class ClanMasteryData implements IXmlReader
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(ClanMasteryData.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(ClanMasteryData.class.getName());
|
||||
|
||||
private final Map<Integer, ClanMasteryHolder> _clanMasteryData = new HashMap<>();
|
||||
|
||||
|
@ -34,7 +34,7 @@ import org.l2jmobius.gameserver.model.items.Item;
|
||||
*/
|
||||
public class ClanShopData implements IXmlReader
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(ClanShopData.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(ClanShopData.class.getName());
|
||||
|
||||
private final List<ClanShopProductHolder> _clanShopProducts = new ArrayList<>();
|
||||
|
||||
|
@ -36,7 +36,7 @@ import org.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
*/
|
||||
public class EquipmentUpgradeData implements IXmlReader
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(EquipmentUpgradeData.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(EquipmentUpgradeData.class.getName());
|
||||
private static final Map<Integer, EquipmentUpgradeHolder> _upgrades = new HashMap<>();
|
||||
|
||||
protected EquipmentUpgradeData()
|
||||
|
@ -37,7 +37,7 @@ import org.l2jmobius.gameserver.model.holders.FakePlayerHolder;
|
||||
*/
|
||||
public class FakePlayerData implements IXmlReader
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(FakePlayerData.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(FakePlayerData.class.getName());
|
||||
|
||||
private final Map<Integer, FakePlayerHolder> _fakePlayerInfos = new HashMap<>();
|
||||
private final Map<String, String> _fakePlayerNames = new HashMap<>();
|
||||
|
@ -81,7 +81,7 @@ public class PetDataTable implements IXmlReader
|
||||
{
|
||||
for (String foodId : attrs.getNamedItem("val").getNodeValue().split(";"))
|
||||
{
|
||||
data.addFood(Integer.valueOf(foodId));
|
||||
data.addFood(Integer.parseInt(foodId));
|
||||
}
|
||||
}
|
||||
else if ("load".equals(type))
|
||||
|
@ -36,7 +36,7 @@ import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
*/
|
||||
public class PetSkillData implements IXmlReader
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(PetSkillData.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(PetSkillData.class.getName());
|
||||
private final Map<Integer, Map<Long, SkillHolder>> _skillTrees = new HashMap<>();
|
||||
|
||||
protected PetSkillData()
|
||||
|
@ -262,7 +262,7 @@ public class SkillTreesData implements IXmlReader
|
||||
}
|
||||
case "residenceId":
|
||||
{
|
||||
skillLearn.addResidenceId(Integer.valueOf(b.getTextContent()));
|
||||
skillLearn.addResidenceId(Integer.parseInt(b.getTextContent()));
|
||||
break;
|
||||
}
|
||||
case "socialClass":
|
||||
|
@ -32,7 +32,7 @@ import org.l2jmobius.gameserver.model.holders.TeleportListHolder;
|
||||
*/
|
||||
public class TeleportListData implements IXmlReader
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(TeleportListData.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(TeleportListData.class.getName());
|
||||
private final Map<Integer, TeleportListHolder> _teleports = new HashMap<>();
|
||||
private int _teleportsCount = 0;
|
||||
|
||||
|
@ -55,7 +55,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
|
||||
*/
|
||||
public class ItemTable
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
|
||||
private static Logger LOGGER_ITEMS = Logger.getLogger("item");
|
||||
|
||||
public static final Map<String, Long> SLOTS = new HashMap<>();
|
||||
|
@ -143,7 +143,7 @@ public class DocumentItem extends DocumentBase implements IXmlReader
|
||||
if ("stat".equalsIgnoreCase(b.getNodeName()))
|
||||
{
|
||||
final Stats type = Stats.valueOfXml(b.getAttributes().getNamedItem("type").getNodeValue());
|
||||
final double value = Double.valueOf(b.getTextContent());
|
||||
final double value = Double.parseDouble(b.getTextContent());
|
||||
_currentItem.item.addFunctionTemplate(new FuncTemplate(null, null, "add", 0x00, type, value));
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public enum IllegalActionPunishmentType
|
||||
{
|
||||
for (IllegalActionPunishmentType type : values())
|
||||
{
|
||||
if (type.name().toLowerCase().equals(name.toLowerCase()))
|
||||
if (type.name().equalsIgnoreCase(name.toLowerCase()))
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ public class AntiFeedManager
|
||||
return false; // no such event registered
|
||||
}
|
||||
|
||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||
final Integer addrHash = client.getConnectionAddress().hashCode();
|
||||
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
|
||||
|
||||
if (!Config.DUALBOX_COUNT_OFFLINE_TRADERS)
|
||||
@ -211,8 +211,7 @@ public class AntiFeedManager
|
||||
return false; // no such event registered
|
||||
}
|
||||
|
||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||
|
||||
final Integer addrHash = client.getConnectionAddress().hashCode();
|
||||
return event.computeIfPresent(addrHash, (k, v) ->
|
||||
{
|
||||
if ((v == null) || (v.decrementAndGet() == 0))
|
||||
@ -275,7 +274,7 @@ public class AntiFeedManager
|
||||
return max;
|
||||
}
|
||||
|
||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||
final Integer addrHash = client.getConnectionAddress().hashCode();
|
||||
int limit = max;
|
||||
if (Config.DUALBOX_CHECK_WHITELIST.containsKey(addrHash))
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
*/
|
||||
public class FactionManager
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(FactionManager.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(FactionManager.class.getName());
|
||||
private final Map<Integer, Integer> _playerFactions = new ConcurrentHashMap<>();
|
||||
|
||||
protected FactionManager()
|
||||
|
@ -43,7 +43,7 @@ import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
*/
|
||||
public class FakePlayerChatManager implements IXmlReader
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(FakePlayerChatManager.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(FakePlayerChatManager.class.getName());
|
||||
final List<FakePlayerChatHolder> MESSAGES = new ArrayList<>();
|
||||
private static final int MIN_DELAY = 5000;
|
||||
private static final int MAX_DELAY = 15000;
|
||||
|
@ -47,7 +47,7 @@ public class GrandBossManager implements IStorable
|
||||
private static final String UPDATE_GRAND_BOSS_DATA = "UPDATE grandboss_data set loc_x = ?, loc_y = ?, loc_z = ?, heading = ?, respawn_time = ?, currentHP = ?, currentMP = ?, status = ? where boss_id = ?";
|
||||
private static final String UPDATE_GRAND_BOSS_DATA2 = "UPDATE grandboss_data set status = ? where boss_id = ?";
|
||||
|
||||
protected static Logger LOGGER = Logger.getLogger(GrandBossManager.class.getName());
|
||||
protected static final Logger LOGGER = Logger.getLogger(GrandBossManager.class.getName());
|
||||
|
||||
protected static Map<Integer, GrandBossInstance> _bosses = new ConcurrentHashMap<>();
|
||||
|
||||
|
@ -35,7 +35,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
public class BlockList
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(BlockList.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(BlockList.class.getName());
|
||||
private static final Map<Integer, List<Integer>> OFFLINE_LIST = new ConcurrentHashMap<>();
|
||||
|
||||
private final PlayerInstance _owner;
|
||||
|
@ -36,7 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ShortCutRegister;
|
||||
|
||||
public class ShortCuts implements IRestorable
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(ShortCuts.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(ShortCuts.class.getName());
|
||||
private static final int MAX_SHORTCUTS_PER_BAR = 12;
|
||||
private final PlayerInstance _owner;
|
||||
private final Map<Integer, Shortcut> _shortCuts = new TreeMap<>();
|
||||
|
@ -28,7 +28,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
*/
|
||||
public class Territory
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(Territory.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(Territory.class.getName());
|
||||
|
||||
protected static class Point
|
||||
{
|
||||
|
@ -177,7 +177,7 @@ public class TeleporterInstance extends Npc
|
||||
final String token = st.nextToken();
|
||||
if (Util.isDigit(token))
|
||||
{
|
||||
return Integer.valueOf(token);
|
||||
return Integer.parseInt(token);
|
||||
}
|
||||
}
|
||||
return defaultVal;
|
||||
|
@ -45,7 +45,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
*/
|
||||
public class VillageMasterInstance extends NpcInstance
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(VillageMasterInstance.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(VillageMasterInstance.class.getName());
|
||||
|
||||
public VillageMasterInstance(NpcTemplate template)
|
||||
{
|
||||
|
@ -1206,7 +1206,7 @@ public class Olympiad extends ListenersContainer
|
||||
*/
|
||||
public static StatsSet addNobleStats(int charId, StatsSet data)
|
||||
{
|
||||
return NOBLES.put(Integer.valueOf(charId), data);
|
||||
return NOBLES.put(charId, data);
|
||||
}
|
||||
|
||||
public static Olympiad getInstance()
|
||||
|
@ -95,7 +95,7 @@ public class OlympiadManager
|
||||
|
||||
private boolean isRegistered(PlayerInstance noble, PlayerInstance player, boolean showMessage)
|
||||
{
|
||||
final Integer objId = Integer.valueOf(noble.getObjectId());
|
||||
final Integer objId = noble.getObjectId();
|
||||
if (_nonClassBasedRegisters.contains(objId))
|
||||
{
|
||||
if (showMessage)
|
||||
@ -269,7 +269,7 @@ public class OlympiadManager
|
||||
return false;
|
||||
}
|
||||
|
||||
final Integer objId = Integer.valueOf(noble.getObjectId());
|
||||
final Integer objId = noble.getObjectId();
|
||||
if (_nonClassBasedRegisters.remove(objId))
|
||||
{
|
||||
if (Config.DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP > 0)
|
||||
@ -304,7 +304,7 @@ public class OlympiadManager
|
||||
task.getGame().handleDisconnect(player);
|
||||
}
|
||||
|
||||
final Integer objId = Integer.valueOf(player.getObjectId());
|
||||
final Integer objId = player.getObjectId();
|
||||
if (_nonClassBasedRegisters.remove(objId))
|
||||
{
|
||||
return;
|
||||
|
@ -239,7 +239,7 @@ public class PunishmentTask implements Runnable
|
||||
|
||||
if (_type == PunishmentType.CHAT_BAN && _affect == PunishmentAffect.CHARACTER)
|
||||
{
|
||||
final PlayerInstance player = World.getInstance().getPlayer(Integer.valueOf(_key));
|
||||
final PlayerInstance player = World.getInstance().getPlayer(Integer.parseInt(_key));
|
||||
if (player != null)
|
||||
{
|
||||
player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
|
||||
|
@ -42,7 +42,7 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone;
|
||||
*/
|
||||
public abstract class AbstractResidence extends ListenersContainer implements INamable
|
||||
{
|
||||
private final Logger LOGGER = Logger.getLogger(getClass().getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName());
|
||||
private final int _residenceId;
|
||||
private String _name;
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class Hopzone extends VoteSystem
|
||||
{
|
||||
if (line.contains("<li><span class=\"rank anonymous tooltip\" title"))
|
||||
{
|
||||
int votes = Integer.valueOf(line.split(">")[2].replace("</span", ""));
|
||||
int votes = Integer.parseInt(line.split(">")[2].replace("</span", ""));
|
||||
return votes;
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class Network extends VoteSystem
|
||||
{
|
||||
if (line.contains("<div class=\"tls-in-sts\"><b style"))
|
||||
{
|
||||
int votes = Integer.valueOf(line.split(">")[2].replace("</b", ""));
|
||||
int votes = Integer.parseInt(line.split(">")[2].replace("</b", ""));
|
||||
return votes;
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class Topzone extends VoteSystem
|
||||
String line;
|
||||
while ((line = br.readLine()) != null)
|
||||
{
|
||||
int votes = Integer.valueOf(line);
|
||||
int votes = Integer.parseInt(line);
|
||||
return votes;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ import io.netty.channel.socket.nio.NioSocketChannel;
|
||||
*/
|
||||
public class LoginServerNetworkManager
|
||||
{
|
||||
private final Logger LOGGER = Logger.getLogger(getClass().getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(LoginServerNetworkManager.class.getName());
|
||||
|
||||
private final Bootstrap _bootstrap;
|
||||
|
||||
|
@ -29,7 +29,7 @@ import org.l2jmobius.commons.network.BaseSendablePacket;
|
||||
*/
|
||||
public class BlowFishKey extends BaseSendablePacket
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(BlowFishKey.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(BlowFishKey.class.getName());
|
||||
|
||||
/**
|
||||
* @param blowfishKey
|
||||
|
@ -43,7 +43,7 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
|
||||
public class CharSelectionInfo implements IClientOutgoingPacket
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(CharSelectionInfo.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(CharSelectionInfo.class.getName());
|
||||
private final String _loginName;
|
||||
private final int _sessionId;
|
||||
private int _activeId;
|
||||
|
@ -120,7 +120,7 @@ public class TelnetServerHandler extends ChannelInboundHandlerAdapter
|
||||
{
|
||||
response = "Type 'help' to see all available commands." + Config.EOL;
|
||||
}
|
||||
else if (request.toLowerCase().equals("exit"))
|
||||
else if (request.equalsIgnoreCase("exit"))
|
||||
{
|
||||
response = "Have a good day!" + Config.EOL;
|
||||
close = true;
|
||||
|
@ -41,7 +41,7 @@ import org.l2jmobius.gameserver.util.Util;
|
||||
*/
|
||||
public class SecondaryPasswordAuth
|
||||
{
|
||||
private final Logger LOGGER = Logger.getLogger(SecondaryPasswordAuth.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(SecondaryPasswordAuth.class.getName());
|
||||
private final GameClient _activeClient;
|
||||
|
||||
private String _password;
|
||||
|
@ -226,14 +226,14 @@ public class TaskManager
|
||||
}
|
||||
case TYPE_SHEDULED:
|
||||
{
|
||||
delay = Long.valueOf(task.getParams()[0]);
|
||||
delay = Long.parseLong(task.getParams()[0]);
|
||||
task.scheduled = ThreadPool.schedule(task, delay);
|
||||
return true;
|
||||
}
|
||||
case TYPE_FIXED_SHEDULED:
|
||||
{
|
||||
delay = Long.valueOf(task.getParams()[0]);
|
||||
interval = Long.valueOf(task.getParams()[1]);
|
||||
delay = Long.parseLong(task.getParams()[0]);
|
||||
interval = Long.parseLong(task.getParams()[1]);
|
||||
task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
|
||||
return true;
|
||||
}
|
||||
@ -267,7 +267,7 @@ public class TaskManager
|
||||
}
|
||||
case TYPE_GLOBAL_TASK:
|
||||
{
|
||||
interval = Long.valueOf(task.getParams()[0]) * 86400000;
|
||||
interval = Long.parseLong(task.getParams()[0]) * 86400000;
|
||||
final String[] hour = task.getParams()[1].split(":");
|
||||
|
||||
if (hour.length != 3)
|
||||
|
@ -114,7 +114,7 @@ public class Gui
|
||||
final String input = ((String) answer).trim();
|
||||
if (Util.isDigit(input))
|
||||
{
|
||||
final int delay = Integer.valueOf(input);
|
||||
final int delay = Integer.parseInt(input);
|
||||
if (delay > 0)
|
||||
{
|
||||
Shutdown.getInstance().startShutdown(null, delay, false);
|
||||
@ -137,7 +137,7 @@ public class Gui
|
||||
final String input = ((String) answer).trim();
|
||||
if (Util.isDigit(input))
|
||||
{
|
||||
final int delay = Integer.valueOf(input);
|
||||
final int delay = Integer.parseInt(input);
|
||||
if (delay > 0)
|
||||
{
|
||||
Shutdown.getInstance().startShutdown(null, delay, true);
|
||||
|
@ -35,7 +35,7 @@ import org.l2jmobius.gameserver.network.serverpackets.RelationChanged;
|
||||
*/
|
||||
public class Broadcast
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(Broadcast.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(Broadcast.class.getName());
|
||||
|
||||
/**
|
||||
* Send a packet to all PlayerInstance in the _KnownPlayers of the Creature that have the Character targeted.<BR>
|
||||
|
@ -73,7 +73,7 @@ public class Expression
|
||||
public Expression setVariable(String name, double value)
|
||||
{
|
||||
checkVariableName(name);
|
||||
variables.put(name, Double.valueOf(value));
|
||||
variables.put(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ import org.l2jmobius.Config;
|
||||
*/
|
||||
public abstract class FloodProtectedListener extends Thread
|
||||
{
|
||||
private final Logger LOGGER = Logger.getLogger(FloodProtectedListener.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(FloodProtectedListener.class.getName());
|
||||
private final Map<String, ForeignConnection> _floodProtection = new ConcurrentHashMap<>();
|
||||
private ServerSocket _serverSocket;
|
||||
|
||||
|
@ -38,7 +38,7 @@ import org.l2jmobius.loginserver.network.loginserverpackets.LoginServerFail;
|
||||
*/
|
||||
public class GameServerPacketHandler
|
||||
{
|
||||
protected static Logger LOGGER = Logger.getLogger(GameServerPacketHandler.class.getName());
|
||||
protected static final Logger LOGGER = Logger.getLogger(GameServerPacketHandler.class.getName());
|
||||
|
||||
public enum GameServerState
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ import org.l2jmobius.loginserver.network.serverpackets.ServerList;
|
||||
*/
|
||||
public class RequestAuthLogin implements IIncomingPacket<LoginClient>
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(RequestAuthLogin.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(RequestAuthLogin.class.getName());
|
||||
|
||||
private final byte[] _raw1 = new byte[128];
|
||||
private final byte[] _raw2 = new byte[128];
|
||||
|
@ -40,7 +40,7 @@ import org.l2jmobius.loginserver.network.serverpackets.ServerList;
|
||||
|
||||
public class RequestCmdLogin implements IIncomingPacket<LoginClient>
|
||||
{
|
||||
private static Logger LOGGER = Logger.getLogger(RequestCmdLogin.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(RequestCmdLogin.class.getName());
|
||||
|
||||
private final byte[] _raw = new byte[128];
|
||||
|
||||
|
@ -27,7 +27,7 @@ import org.l2jmobius.loginserver.LoginController;
|
||||
*/
|
||||
public class ChangeAccessLevel extends BaseRecievePacket
|
||||
{
|
||||
protected static Logger LOGGER = Logger.getLogger(ChangeAccessLevel.class.getName());
|
||||
protected static final Logger LOGGER = Logger.getLogger(ChangeAccessLevel.class.getName());
|
||||
|
||||
/**
|
||||
* @param decrypt
|
||||
|
@ -35,7 +35,7 @@ import org.l2jmobius.loginserver.GameServerThread;
|
||||
*/
|
||||
public class ChangePassword extends BaseRecievePacket
|
||||
{
|
||||
protected static Logger LOGGER = Logger.getLogger(ChangePassword.class.getName());
|
||||
protected static final Logger LOGGER = Logger.getLogger(ChangePassword.class.getName());
|
||||
private static GameServerThread gst = null;
|
||||
|
||||
public ChangePassword(byte[] decrypt)
|
||||
|
@ -45,7 +45,7 @@ import org.l2jmobius.loginserver.network.loginserverpackets.LoginServerFail;
|
||||
*/
|
||||
public class GameServerAuth extends BaseRecievePacket
|
||||
{
|
||||
protected static Logger LOGGER = Logger.getLogger(GameServerAuth.class.getName());
|
||||
protected static final Logger LOGGER = Logger.getLogger(GameServerAuth.class.getName());
|
||||
GameServerThread _server;
|
||||
private final byte[] _hexId;
|
||||
private final int _desiredId;
|
||||
|
@ -26,7 +26,7 @@ import org.l2jmobius.loginserver.GameServerThread;
|
||||
*/
|
||||
public class PlayerLogout extends BaseRecievePacket
|
||||
{
|
||||
protected static Logger LOGGER = Logger.getLogger(PlayerLogout.class.getName());
|
||||
protected static final Logger LOGGER = Logger.getLogger(PlayerLogout.class.getName());
|
||||
|
||||
/**
|
||||
* @param decrypt
|
||||
|
@ -26,7 +26,7 @@ import org.l2jmobius.loginserver.LoginController;
|
||||
*/
|
||||
public class PlayerTracert extends BaseRecievePacket
|
||||
{
|
||||
protected static Logger LOGGER = Logger.getLogger(PlayerTracert.class.getName());
|
||||
protected static final Logger LOGGER = Logger.getLogger(PlayerTracert.class.getName());
|
||||
|
||||
/**
|
||||
* @param decrypt
|
||||
|
@ -28,7 +28,7 @@ import org.l2jmobius.loginserver.GameServerThread;
|
||||
*/
|
||||
public class ServerStatus extends BaseRecievePacket
|
||||
{
|
||||
protected static Logger LOGGER = Logger.getLogger(ServerStatus.class.getName());
|
||||
protected static final Logger LOGGER = Logger.getLogger(ServerStatus.class.getName());
|
||||
|
||||
public static final int SERVER_LIST_STATUS = 0x01;
|
||||
public static final int SERVER_TYPE = 0x02;
|
||||
|
Reference in New Issue
Block a user