Various code changes.

This commit is contained in:
MobiusDev
2018-04-11 11:25:53 +00:00
parent db9a123081
commit 847ff1fa4f
713 changed files with 2432 additions and 4262 deletions

View File

@@ -3,7 +3,7 @@
<activityTime val="60" />
<allowSummon val="false" />
<emptyDestroyTime val="240" />
<reenter additionStyle="ON_INSTANCE_ENTER">
<reenter additionStyle="ON_ENTER">
<reset time="14400000" />
</reenter>
</instance>

View File

@@ -4,7 +4,7 @@
<allowSummon val="false"/>
<showTimer val="true" increase="true" text="Elapsed Time :" />
<exitPoint x="52212" y="218998" z="-3208" />
<reenter additionStyle="ON_INSTANCE_FINISH" >
<reenter additionStyle="ON_FINISH" >
<reset day="Monday" hour="6" minute="30" />
<reset day="Wednesday" hour="6" minute="30" />
<reset day="Friday" hour="6" minute="30" />

View File

@@ -4,7 +4,7 @@
<allowSummon val="false"/>
<showTimer val="true" increase="true" text="Elapsed Time :" />
<exitPoint x="52212" y="218998" z="-3208" />
<reenter additionStyle="ON_INSTANCE_FINISH" >
<reenter additionStyle="ON_FINISH" >
<reset day="Monday" hour="6" minute="30" />
<reset day="Wednesday" hour="6" minute="30" />
<reset day="Friday" hour="6" minute="30" />

View File

@@ -4,7 +4,7 @@
<allowSummon val="false"/>
<showTimer val="true" increase="true" text="Elapsed Time :" />
<exitPoint x="52212" y="218998" z="-3208" />
<reenter additionStyle="ON_INSTANCE_FINISH" >
<reenter additionStyle="ON_FINISH" >
<reset day="Monday" hour="6" minute="30" />
<reset day="Wednesday" hour="6" minute="30" />
<reset day="Friday" hour="6" minute="30" />

View File

@@ -4,7 +4,7 @@
<allowSummon val="false" />
<emptyDestroyTime val="1200" />
<exitPoint x="149442" y="173520" z="-5024" />
<reenter additionStyle="ON_INSTANCE_ENTER" >
<reenter additionStyle="ON_ENTER" >
<reset time="86400000" />
</reenter>
<doorlist>

View File

@@ -4,7 +4,7 @@
<allowSummon val="false" />
<emptyDestroyTime val="600" />
<exitPoint x="-22213" y="277138" z="-9930" />
<reenter additionStyle="ON_INSTANCE_FINISH" >
<reenter additionStyle="ON_FINISH" >
<reset day="Wednesday" hour="6" minute="30" />
<reset day="Saturday" hour="6" minute="30" />
</reenter>

View File

@@ -4,7 +4,7 @@
<allowSummon val="false" />
<emptyDestroyTime val="600" />
<exitPoint x="115717" y="-125734" z="-3392" />
<reenter additionStyle="ON_INSTANCE_FINISH" >
<reenter additionStyle="ON_FINISH" >
<reset day="Wednesday" hour="6" minute="30" />
<reset day="Saturday" hour="6" minute="30" />
</reenter>

View File

@@ -4,7 +4,7 @@
<allowSummon val="false" />
<emptyDestroyTime val="600" />
<exitPoint x="115717" y="-125734" z="-3392" />
<reenter additionStyle="ON_INSTANCE_FINISH" >
<reenter additionStyle="ON_FINISH" >
<reset day="Wednesday" hour="6" minute="30" />
<reset day="Saturday" hour="6" minute="30" />
</reenter>

View File

@@ -4,7 +4,7 @@
<allowSummon val="false" />
<emptyDestroyTime val="600" />
<exitPoint x="115717" y="-125734" z="-3392" />
<reenter additionStyle="ON_INSTANCE_FINISH" >
<reenter additionStyle="ON_FINISH" >
<reset day="Wednesday" hour="6" minute="30" />
<reset day="Saturday" hour="6" minute="30" />
</reenter>

View File

@@ -4,7 +4,7 @@
<allowSummon val="false" />
<emptyDestroyTime val="600" />
<exitPoint x="-19006" y="277065" z="-13383" />
<reenter additionStyle="ON_INSTANCE_FINISH" >
<reenter additionStyle="ON_FINISH" >
<reset day="Wednesday" hour="6" minute="30" />
<reset day="Saturday" hour="6" minute="30" />
</reenter>

View File

@@ -4,7 +4,7 @@
<allowSummon val="false" />
<emptyDestroyTime val="900" />
<exitPoint x="-248717" y="250260" z="4337" />
<reenter additionStyle="ON_INSTANCE_FINISH" >
<reenter additionStyle="ON_FINISH" >
<reset day="Wednesday" hour="6" minute="30" />
<reset day="Saturday" hour="6" minute="30" />
</reenter>

View File

@@ -23,7 +23,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -283,7 +283,7 @@ public final class BeastFarm extends AbstractNpcAI
final SkillData st = SkillData.getInstance();
for (SkillHolder sh : beast.getSkills())
{
nextNpc.addBeastSkill(st.getSkill(sh.getSkillId(), sh.getSkillLvl()));
nextNpc.addBeastSkill(st.getSkill(sh.getSkillId(), sh.getSkillLevel()));
}
Q00020_BringUpWithLove.checkJewelOfInnocence(player);

View File

@@ -17,7 +17,7 @@
package ai.areas.DenOfEvil;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;

View File

@@ -20,7 +20,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;

View File

@@ -21,7 +21,7 @@ import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Party;

View File

@@ -21,7 +21,7 @@ import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Party;

View File

@@ -25,7 +25,7 @@ import java.util.Map;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.SoDManager;
import com.l2jmobius.gameserver.model.L2CommandChannel;

View File

@@ -29,7 +29,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;

View File

@@ -29,7 +29,7 @@ import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
import com.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager.StatusEnum;

View File

@@ -16,7 +16,7 @@
*/
package ai.areas.HotSprings;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;

View File

@@ -19,7 +19,7 @@ package ai.areas.KetraOrcOutpust.KetraOrcSupport;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.Skill;

View File

@@ -18,7 +18,7 @@ package ai.areas.SelMahumTrainingGrounds;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.Location;

View File

@@ -18,7 +18,7 @@ package ai.areas.StakatoNest;
import java.util.List;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;

View File

@@ -19,7 +19,7 @@ package ai.areas.VarkaSilenosBarracks.VarkaSilenosSupport;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.Skill;

View File

@@ -21,7 +21,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
import com.l2jmobius.gameserver.model.L2Object;

View File

@@ -21,7 +21,7 @@ import java.util.List;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.MountType;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;

View File

@@ -20,8 +20,8 @@ import java.util.List;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.data.xml.impl.MultisellData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.instancemanager.QuestManager;
import com.l2jmobius.gameserver.model.L2SkillLearn;
import com.l2jmobius.gameserver.model.actor.L2Npc;

View File

@@ -19,8 +19,8 @@ package ai.others.HealerTrainer;
import java.util.Collection;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.model.L2SkillLearn;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;

View File

@@ -18,7 +18,7 @@ package ai.others.NpcBuffers.impl;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.SevenSigns;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.L2Npc;

View File

@@ -23,7 +23,7 @@ import java.util.Map.Entry;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.actor.L2Npc;

View File

@@ -28,7 +28,7 @@ import java.util.List;
import com.l2jmobius.Config;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.QuestManager;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.L2Summon;

View File

@@ -22,7 +22,7 @@ import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;

View File

@@ -18,7 +18,7 @@ package handlers.admincommandhandlers;
import java.util.StringTokenizer;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.Team;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;

View File

@@ -33,9 +33,9 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemGroupsData;
import com.l2jmobius.gameserver.data.xml.impl.MultisellData;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.PrimeShopData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.TransformData;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import com.l2jmobius.gameserver.instancemanager.QuestManager;

View File

@@ -22,8 +22,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.data.xml.impl.ClassListData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Object;

View File

@@ -21,7 +21,7 @@ import java.util.StringTokenizer;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;

View File

@@ -34,7 +34,7 @@ import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
import com.l2jmobius.gameserver.data.xml.impl.MultisellData;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.handler.CommunityBoardHandler;
import com.l2jmobius.gameserver.handler.IParseBoardHandler;
import com.l2jmobius.gameserver.instancemanager.PremiumManager;

View File

@@ -85,7 +85,7 @@ public final class CallPc extends AbstractEffect
target.addScript(new SummonRequestHolder(activeChar, info.getSkill()));
final ConfirmDlg confirm = new ConfirmDlg(SystemMessageId.C1_WISHES_TO_SUMMON_YOU_FROM_S2_DO_YOU_ACCEPT.getId());
confirm.addCharName(activeChar);
confirm.addString(activeChar.getName());
confirm.addZoneName(activeChar.getX(), activeChar.getY(), activeChar.getZ());
confirm.addTime(30000);
confirm.addRequesterId(activeChar.getObjectId());
@@ -139,7 +139,7 @@ public final class CallPc extends AbstractEffect
if (target.inObserverMode())
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_STATE_WHICH_PREVENTS_SUMMONING);
sm.addCharName(target);
sm.addString(target.getName());
activeChar.sendPacket(sm);
return false;
}

View File

@@ -76,7 +76,7 @@ public final class HealPercent extends AbstractEffect
if (info.getEffector().getObjectId() != target.getObjectId())
{
sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1);
sm.addCharName(info.getEffector());
sm.addString(info.getEffector().getName());
}
else
{

View File

@@ -54,8 +54,8 @@ public final class MagicalAttackMp extends AbstractEffect
if (info.getEffected().isPlayer())
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_RESISTED_C2_S_MAGIC);
sm.addCharName(info.getEffected());
sm.addCharName(info.getEffector());
sm.addString(info.getEffected().getName());
sm.addString(info.getEffector().getName());
info.getEffected().sendPacket(sm);
}
return false;
@@ -102,7 +102,7 @@ public final class MagicalAttackMp extends AbstractEffect
if (target.isPlayer())
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_S_MP_HAS_BEEN_DRAINED_BY_C1);
sm.addCharName(activeChar);
sm.addString(activeChar.getName());
sm.addInt((int) mp);
target.sendPacket(sm);
}

View File

@@ -72,7 +72,7 @@ public final class ManaHeal extends AbstractEffect
if (info.getEffector().getObjectId() != target.getObjectId())
{
sm = SystemMessage.getSystemMessage(SystemMessageId.S2_MP_HAS_BEEN_RESTORED_BY_C1);
sm.addCharName(info.getEffector());
sm.addString(info.getEffector().getName());
}
else
{

View File

@@ -123,7 +123,7 @@ public final class ManaHealByLevel extends AbstractEffect
final SystemMessage sm = SystemMessage.getSystemMessage(info.getEffector().getObjectId() != target.getObjectId() ? SystemMessageId.S2_MP_HAS_BEEN_RESTORED_BY_C1 : SystemMessageId.S1_MP_HAS_BEEN_RESTORED);
if (info.getEffector().getObjectId() != target.getObjectId())
{
sm.addCharName(info.getEffector());
sm.addString(info.getEffector().getName());
}
sm.addInt((int) amount);
target.sendPacket(sm);

View File

@@ -76,7 +76,7 @@ public final class ManaHealPercent extends AbstractEffect
if (info.getEffector().getObjectId() != target.getObjectId())
{
sm = SystemMessage.getSystemMessage(SystemMessageId.S2_MP_HAS_BEEN_RESTORED_BY_C1);
sm.addCharName(info.getEffector());
sm.addString(info.getEffector().getName());
}
else
{

View File

@@ -16,7 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.conditions.Condition;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;

View File

@@ -85,7 +85,7 @@ public final class TriggerSkillByAttack extends AbstractEffect
public void onAttackEvent(OnCreatureDamageDealt event)
{
if (event.isDamageOverTime() || (_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLvl() == 0)))
if (event.isDamageOverTime() || (_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLevel() == 0)))
{
return;
}

View File

@@ -60,7 +60,7 @@ public final class TriggerSkillByAvoid extends AbstractEffect
public void onAvoidEvent(OnCreatureAttackAvoid event)
{
if (event.isDamageOverTime() || (_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLvl() == 0)))
if (event.isDamageOverTime() || (_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLevel() == 0)))
{
return;
}

View File

@@ -62,7 +62,7 @@ public final class TriggerSkillByDamage extends AbstractEffect
public void onDamageReceivedEvent(OnCreatureDamageReceived event)
{
if (event.isDamageOverTime() || (_chance == 0) || (_skill.getSkillLvl() == 0))
if (event.isDamageOverTime() || (_chance == 0) || (_skill.getSkillLevel() == 0))
{
return;
}

View File

@@ -62,7 +62,7 @@ public final class TriggerSkillBySkill extends AbstractEffect
public void onSkillUseEvent(OnCreatureSkillUse event)
{
if ((_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLvl() == 0) || (_castSkillId == 0)))
if ((_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLevel() == 0) || (_castSkillId == 0)))
{
return;
}

View File

@@ -97,7 +97,7 @@ public class BeastSoulShot implements IItemHandler
activeOwner.sendPacket(SystemMessageId.YOUR_PET_USES_SPIRITSHOT);
activeOwner.getSummon().setChargedShot(ShotType.SOULSHOTS, true);
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activeOwner.getSummon(), activeOwner.getSummon(), skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activeOwner.getSummon(), activeOwner.getSummon(), skills[0].getSkillId(), skills[0].getSkillLevel(), 0, 0), 600);
return true;
}
}

View File

@@ -97,7 +97,7 @@ public class BeastSpiritShot implements IItemHandler
activeOwner.sendPacket(SystemMessageId.YOUR_PET_USES_SPIRITSHOT);
activeOwner.getSummon().setChargedShot(isBlessed ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, true);
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activeOwner.getSummon(), activeOwner.getSummon(), skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activeOwner.getSummon(), activeOwner.getSummon(), skills[0].getSkillId(), skills[0].getSkillLevel(), 0, 0), 600);
return true;
}
}

View File

@@ -97,7 +97,7 @@ public class BlessedSpiritShot implements IItemHandler
activeChar.sendPacket(SystemMessageId.YOUR_SPIRITSHOT_HAS_BEEN_ENABLED);
activeChar.setChargedShot(ShotType.BLESSED_SPIRITSHOTS, true);
Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getSkillId(), skills[0].getSkillLevel(), 0, 0), 600);
return true;
}
}

View File

@@ -87,7 +87,7 @@ public class FishShots implements IItemHandler
final L2Object oldTarget = activeChar.getTarget();
activeChar.setTarget(activeChar);
Broadcast.toSelfAndKnownPlayers(activeChar, new MagicSkillUse(activeChar, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0));
Broadcast.toSelfAndKnownPlayers(activeChar, new MagicSkillUse(activeChar, skills[0].getSkillId(), skills[0].getSkillLevel(), 0, 0));
activeChar.setTarget(oldTarget);
return true;
}

View File

@@ -20,7 +20,7 @@ import java.util.List;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.data.xml.impl.PetDataTable;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.handler.IItemHandler;
import com.l2jmobius.gameserver.model.actor.L2Playable;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -51,7 +51,7 @@ public class PetFood implements IItemHandler
{
for (SkillHolder sk : skills)
{
useFood(playable, sk.getSkillId(), sk.getSkillLvl(), item);
useFood(playable, sk.getSkillId(), sk.getSkillLevel(), item);
}
}
return true;

View File

@@ -110,7 +110,7 @@ public class SoulShots implements IItemHandler
// Send message to client
activeChar.sendPacket(SystemMessageId.YOUR_SOULSHOTS_ARE_ENABLED);
Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getSkillId(), skills[0].getSkillLevel(), 0, 0), 600);
return true;
}
}

View File

@@ -97,7 +97,7 @@ public class SpiritShot implements IItemHandler
// Send message to client
activeChar.sendPacket(SystemMessageId.YOUR_SPIRITSHOT_HAS_BEEN_ENABLED);
Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skills[0].getSkillId(), skills[0].getSkillLevel(), 0, 0), 600);
return true;
}
}

View File

@@ -32,9 +32,9 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemData;
import com.l2jmobius.gameserver.data.xml.impl.EnchantItemGroupsData;
import com.l2jmobius.gameserver.data.xml.impl.MultisellData;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.TransformData;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.instancemanager.QuestManager;
import com.l2jmobius.gameserver.instancemanager.WalkingManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;

View File

@@ -20,7 +20,7 @@ import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.handler.IUserCommandHandler;
import com.l2jmobius.gameserver.model.TeleportWhereType;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;

View File

@@ -28,7 +28,7 @@ import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.SevenSigns;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.PlayerAction;
import com.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import com.l2jmobius.gameserver.instancemanager.CoupleManager;

View File

@@ -82,7 +82,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
onEnterInstance(player, instance, true);
final Instance inst = InstanceManager.getInstance().getInstance(instance.getInstanceId());
if (inst.getReenterType() == InstanceReenterType.ON_INSTANCE_ENTER)
if (inst.getReenterType() == InstanceReenterType.ON_ENTER)
{
handleReenterTime(instance);
}
@@ -103,7 +103,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
{
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
if (inst.getReenterType() == InstanceReenterType.ON_INSTANCE_FINISH)
if (inst.getReenterType() == InstanceReenterType.ON_FINISH)
{
handleReenterTime(world);
}

View File

@@ -24,7 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.TrapAction;
import com.l2jmobius.gameserver.geoengine.GeoEngine;

View File

@@ -815,7 +815,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IGameXm
{
_world.OnSong = element;
broadCastPacket(_world, new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 4000, false, null, element.songName, null));
broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, element.skill.getSkillId(), element.skill.getSkillLvl(), element.skill.getSkill().getHitTime(), 0));
broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, element.skill.getSkillId(), element.skill.getSkillLevel(), element.skill.getSkill().getHitTime(), 0));
_world.songEffectTask = ThreadPool.schedule(new SongTask(_world, 1), element.skill.getSkill().getHitTime() - 10000);
_world.songTask = ThreadPool.schedule(new SongTask(_world, 0), element.skill.getSkill().getHitTime());
break;

View File

@@ -23,7 +23,7 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;

View File

@@ -24,7 +24,7 @@ import java.util.Map;
import java.util.function.Function;
import java.util.logging.Level;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2Spawn;

View File

@@ -16,7 +16,7 @@
*/
package instances.NornilsGarden;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.Location;

View File

@@ -25,7 +25,7 @@ import java.util.Map;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.Location;

View File

@@ -16,7 +16,7 @@
*/
package quests.Q00242_PossessorOfAPreciousSoul2;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;

View File

@@ -89,8 +89,8 @@
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="NONE" />
<xs:enumeration value="ON_INSTANCE_ENTER" />
<xs:enumeration value="ON_INSTANCE_FINISH" />
<xs:enumeration value="ON_ENTER" />
<xs:enumeration value="ON_FINISH" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>

View File

@@ -21,12 +21,11 @@ import java.lang.management.ManagementFactory;
import java.lang.management.MonitorInfo;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
import java.time.Duration;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.Shutdown;
import com.l2jmobius.gameserver.util.Broadcast;
/**
* Thread to check for deadlocked threads.
@@ -34,16 +33,17 @@ import com.l2jmobius.gameserver.util.Broadcast;
*/
public class DeadLockDetector extends Thread
{
private static Logger _log = Logger.getLogger(DeadLockDetector.class.getName());
/** Interval to check for deadlocked threads */
private static final int _sleepTime = Config.DEADLOCK_CHECK_INTERVAL * 1000;
private static Logger LOGGER = Logger.getLogger(DeadLockDetector.class.getName());
private final Duration _checkInterval;
private final Runnable _deadLockCallback;
private final ThreadMXBean tmx;
public DeadLockDetector()
public DeadLockDetector(Duration checkInterval, Runnable deadLockCallback)
{
super("DeadLockDetector");
_checkInterval = checkInterval;
_deadLockCallback = deadLockCallback;
tmx = ManagementFactory.getThreadMXBean();
}
@@ -102,19 +102,19 @@ public class DeadLockDetector extends Thread
info.append(Config.EOL);
}
}
_log.warning(info.toString());
if (Config.RESTART_ON_DEADLOCK)
LOGGER.warning(info.toString());
if (_deadLockCallback != null)
{
Broadcast.toAllOnlinePlayers("Server has stability issues - restarting now.");
Shutdown.getInstance().startTelnetShutdown("DeadLockDetector - Auto Restart", 60, true);
_deadLockCallback.run();
}
}
Thread.sleep(_sleepTime);
Thread.sleep(_checkInterval.toMillis());
}
catch (Exception e)
{
_log.log(Level.WARNING, "DeadLockDetector: ", e);
LOGGER.log(Level.WARNING, "DeadLockDetector: ", e);
}
}
}

View File

@@ -29,7 +29,7 @@ import java.util.logging.Logger;
*/
public final class PropertiesParser
{
private static final Logger _log = Logger.getLogger(PropertiesParser.class.getName());
private static final Logger LOGGER = Logger.getLogger(PropertiesParser.class.getName());
private final Properties _properties = new Properties();
private final File _file;
@@ -51,7 +51,7 @@ public final class PropertiesParser
}
catch (Exception e)
{
_log.warning("[" + _file.getName() + "] There was an error loading config reason: " + e.getMessage());
LOGGER.warning("[" + _file.getName() + "] There was an error loading config reason: " + e.getMessage());
}
}
@@ -71,7 +71,7 @@ public final class PropertiesParser
final String value = getValue(key);
if (value == null)
{
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
return defaultValue;
}
@@ -85,7 +85,7 @@ public final class PropertiesParser
}
else
{
_log.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"boolean\" using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"boolean\" using default value: " + defaultValue);
return defaultValue;
}
}
@@ -95,7 +95,7 @@ public final class PropertiesParser
final String value = getValue(key);
if (value == null)
{
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
return defaultValue;
}
@@ -105,7 +105,7 @@ public final class PropertiesParser
}
catch (NumberFormatException e)
{
_log.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"byte\" using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"byte\" using default value: " + defaultValue);
return defaultValue;
}
}
@@ -115,7 +115,7 @@ public final class PropertiesParser
final String value = getValue(key);
if (value == null)
{
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
return defaultValue;
}
@@ -125,7 +125,7 @@ public final class PropertiesParser
}
catch (NumberFormatException e)
{
_log.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"short\" using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"short\" using default value: " + defaultValue);
return defaultValue;
}
}
@@ -135,7 +135,7 @@ public final class PropertiesParser
final String value = getValue(key);
if (value == null)
{
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
return defaultValue;
}
@@ -145,7 +145,7 @@ public final class PropertiesParser
}
catch (NumberFormatException e)
{
_log.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"int\" using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"int\" using default value: " + defaultValue);
return defaultValue;
}
}
@@ -155,7 +155,7 @@ public final class PropertiesParser
final String value = getValue(key);
if (value == null)
{
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
return defaultValue;
}
@@ -165,7 +165,7 @@ public final class PropertiesParser
}
catch (NumberFormatException e)
{
_log.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"long\" using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"long\" using default value: " + defaultValue);
return defaultValue;
}
}
@@ -175,7 +175,7 @@ public final class PropertiesParser
final String value = getValue(key);
if (value == null)
{
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
return defaultValue;
}
@@ -185,7 +185,7 @@ public final class PropertiesParser
}
catch (NumberFormatException e)
{
_log.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"float\" using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"float\" using default value: " + defaultValue);
return defaultValue;
}
}
@@ -195,7 +195,7 @@ public final class PropertiesParser
final String value = getValue(key);
if (value == null)
{
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
return defaultValue;
}
@@ -205,7 +205,7 @@ public final class PropertiesParser
}
catch (NumberFormatException e)
{
_log.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"double\" using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be \"double\" using default value: " + defaultValue);
return defaultValue;
}
}
@@ -213,12 +213,12 @@ public final class PropertiesParser
public String getString(String key, String defaultValue)
{
final String value = getValue(key);
if (value != null)
if (value == null)
{
return value;
LOGGER.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
return defaultValue;
}
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
return defaultValue;
return value;
}
public <T extends Enum<T>> T getEnum(String key, Class<T> clazz, T defaultValue)
@@ -226,7 +226,7 @@ public final class PropertiesParser
final String value = getValue(key);
if (value == null)
{
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
return defaultValue;
}
@@ -236,7 +236,7 @@ public final class PropertiesParser
}
catch (IllegalArgumentException e)
{
_log.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be enum value of \"" + clazz.getSimpleName() + "\" using default value: " + defaultValue);
LOGGER.warning("[" + _file.getName() + "] Invalid value specified for key: " + key + " specified value: " + value + " should be enum value of \"" + clazz.getSimpleName() + "\" using default value: " + defaultValue);
return defaultValue;
}
}

View File

@@ -30,7 +30,7 @@ import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
*/
public class FortUpdater implements Runnable
{
protected static Logger _log = Logger.getLogger(FortUpdater.class.getName());
protected static Logger LOGGER = Logger.getLogger(FortUpdater.class.getName());
private final L2Clan _clan;
private final Fort _fort;
private int _runCount;
@@ -100,7 +100,7 @@ public class FortUpdater implements Runnable
}
catch (Exception e)
{
_log.log(Level.WARNING, "", e);
LOGGER.log(Level.WARNING, "", e);
}
}

View File

@@ -21,6 +21,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.lang.management.ManagementFactory;
import java.time.Duration;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.LogManager;
@@ -71,6 +72,7 @@ import com.l2jmobius.gameserver.data.xml.impl.PrimeShopData;
import com.l2jmobius.gameserver.data.xml.impl.RecipeData;
import com.l2jmobius.gameserver.data.xml.impl.SecondaryAuthData;
import com.l2jmobius.gameserver.data.xml.impl.SiegeScheduleData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillLearnData;
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
import com.l2jmobius.gameserver.data.xml.impl.StaticObjectData;
@@ -81,7 +83,6 @@ import com.l2jmobius.gameserver.datatables.BotReportTable;
import com.l2jmobius.gameserver.datatables.EventDroplist;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.datatables.MerchantPriceConfigTable;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.handler.EffectHandler;
@@ -138,8 +139,9 @@ import com.l2jmobius.gameserver.network.loginserver.LoginServerNetworkManager;
import com.l2jmobius.gameserver.network.telnet.TelnetServer;
import com.l2jmobius.gameserver.scripting.ScriptEngineManager;
import com.l2jmobius.gameserver.taskmanager.TaskManager;
import com.l2jmobius.gameserver.util.Broadcast;
public final class GameServer
public class GameServer
{
private static final Logger LOGGER = Logger.getLogger(GameServer.class.getName());
@@ -175,8 +177,6 @@ public final class GameServer
throw new Exception("Could not initialize the ID factory!");
}
new File("log/game").mkdirs();
// load script engines
printSection("Scripting Engines");
EventDispatcher.getInstance();
@@ -398,7 +398,14 @@ public final class GameServer
if (Config.DEADLOCK_DETECTOR)
{
_deadDetectThread = new DeadLockDetector();
_deadDetectThread = new DeadLockDetector(Duration.ofSeconds(Config.DEADLOCK_CHECK_INTERVAL), () ->
{
if (Config.RESTART_ON_DEADLOCK)
{
Broadcast.toAllOnlinePlayers("Server has stability issues - restarting now.");
Shutdown.getInstance().startTelnetShutdown("DeadLockDetector - Auto Restart", 60, true);
}
});
_deadDetectThread.setDaemon(true);
_deadDetectThread.start();
}
@@ -460,6 +467,8 @@ public final class GameServer
LogManager.getLogManager().readConfiguration(is);
}
new File("log/game").mkdirs();
// Initialize config
Config.load();
printSection("Database");

View File

@@ -32,7 +32,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
*/
public final class GameTimeController extends Thread
{
private static final Logger _log = Logger.getLogger(GameTimeController.class.getName());
private static final Logger LOGGER = Logger.getLogger(GameTimeController.class.getName());
public static final int TICKS_PER_SECOND = 10; // not able to change this without checking through code
public static final int MILLIS_IN_TICK = 1000 / TICKS_PER_SECOND;
@@ -131,13 +131,13 @@ public final class GameTimeController extends Thread
public final void stopTimer()
{
super.interrupt();
_log.log(Level.INFO, "Stopping " + getClass().getSimpleName());
LOGGER.info(getClass().getSimpleName() + ": Stopped.");
}
@Override
public final void run()
{
_log.log(Level.CONFIG, getClass().getSimpleName() + ": Started.");
LOGGER.info(getClass().getSimpleName() + ": Started.");
long nextTickTime, sleepTime;
boolean isNight = isNight();
@@ -157,7 +157,7 @@ public final class GameTimeController extends Thread
}
catch (Throwable e)
{
_log.log(Level.WARNING, "", e);
LOGGER.log(Level.WARNING, getClass().getSimpleName(), e);
}
sleepTime = nextTickTime - System.currentTimeMillis();

View File

@@ -26,7 +26,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
public class MonsterRace
{
protected static final Logger _log = Logger.getLogger(MonsterRace.class.getName());
protected static final Logger LOGGER = Logger.getLogger(MonsterRace.class.getName());
private final L2Npc[] _monsters;
private int[][] _speeds;
@@ -40,11 +40,6 @@ public class MonsterRace
_second = new int[2];
}
public static MonsterRace getInstance()
{
return SingletonHolder._instance;
}
public void newRace()
{
int random = 0;
@@ -72,7 +67,7 @@ public class MonsterRace
}
catch (Exception e)
{
_log.log(Level.WARNING, "Unable to create monster!", e);
LOGGER.log(Level.WARNING, "Unable to create monster!", e);
}
}
newSpeeds();
@@ -133,6 +128,11 @@ public class MonsterRace
return _second[0];
}
public static MonsterRace getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder
{
protected static final MonsterRace _instance = new MonsterRace();

View File

@@ -170,7 +170,7 @@ public class RecipeController
private static class RecipeItemMaker implements Runnable
{
private static final Logger _log = Logger.getLogger(RecipeItemMaker.class.getName());
private static final Logger LOGGER = Logger.getLogger(RecipeItemMaker.class.getName());
protected boolean _isValid;
protected List<TempItem> _items = null;
protected final L2RecipeList _recipeList;
@@ -306,14 +306,14 @@ public class RecipeController
if ((_player == null) || (_target == null))
{
_log.warning("player or target == null (disconnected?), aborting" + _target + _player);
LOGGER.warning("player or target == null (disconnected?), aborting" + _target + _player);
abort();
return;
}
if (!_player.isOnline() || !_target.isOnline())
{
_log.warning("player or target is not online, aborting " + _target + _player);
LOGGER.warning("player or target is not online, aborting " + _target + _player);
abort();
return;
}

View File

@@ -561,7 +561,7 @@ public class Shutdown extends Thread
LOGGER.info("Olympiad System: Data saved(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
Hero.getInstance().shutdown();
LOGGER.info("Hero System: Data saved(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
ClanTable.getInstance().storeClanScore();
ClanTable.getInstance().shutdown();
LOGGER.info("Clan System: Data saved(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
// Save Cursed Weapons data before closing.

View File

@@ -48,7 +48,7 @@ import com.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
*/
public abstract class AbstractAI implements Ctrl
{
protected final Logger _log = Logger.getLogger(getClass().getName());
protected final Logger LOGGER = Logger.getLogger(getClass().getName());
private NextAction _nextAction;
@@ -121,7 +121,7 @@ public abstract class AbstractAI implements Ctrl
}
catch (Exception e)
{
_log.warning(getClass().getSimpleName() + ": Error: " + e.getMessage());
LOGGER.warning(getClass().getSimpleName() + ": Error: " + e.getMessage());
}
}
}
@@ -159,10 +159,6 @@ public abstract class AbstractAI implements Ctrl
private static final int FOLLOW_INTERVAL = 1000;
private static final int ATTACK_FOLLOW_INTERVAL = 500;
/**
* Constructor of AbstractAI.
* @param creature the creature
*/
protected AbstractAI(L2Character creature)
{
_actor = creature;

View File

@@ -30,7 +30,7 @@ import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.data.sql.impl.TerritoryTable;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.AISkillScope;
import com.l2jmobius.gameserver.enums.AIType;
import com.l2jmobius.gameserver.geoengine.GeoEngine;

View File

@@ -28,27 +28,25 @@ import com.l2jmobius.gameserver.network.serverpackets.VehicleStarted;
*/
public class L2BoatAI extends L2VehicleAI
{
public L2BoatAI(L2BoatInstance creature)
public L2BoatAI(L2BoatInstance boat)
{
super(creature);
super(boat);
}
@Override
protected void moveTo(int x, int y, int z)
{
if (_actor.isMovementDisabled())
if (!_actor.isMovementDisabled())
{
return;
if (!_clientMoving)
{
_actor.broadcastPacket(new VehicleStarted(getActor(), 1));
}
_clientMoving = true;
_actor.moveToLocation(x, y, z, 0);
_actor.broadcastPacket(new VehicleDeparture(getActor()));
}
if (!_clientMoving)
{
_actor.broadcastPacket(new VehicleStarted(getActor(), 1));
}
_clientMoving = true;
_actor.moveToLocation(x, y, z, 0);
_actor.broadcastPacket(new VehicleDeparture(getActor()));
}
@Override

View File

@@ -427,7 +427,7 @@ public class L2CharacterAI extends AbstractAI
setTarget(object);
if ((object.getX() == 0) && (object.getY() == 0))
{
_log.warning("Object in coords 0,0 - using a temporary fix");
LOGGER.warning("Object in coords 0,0 - using a temporary fix");
object.setXYZ(getActor().getX(), getActor().getY(), getActor().getZ() + 5);
}
@@ -919,7 +919,7 @@ public class L2CharacterAI extends AbstractAI
{
if (worldPosition == null)
{
_log.warning("maybeMoveToPosition: worldPosition == NULL!");
LOGGER.warning("maybeMoveToPosition: worldPosition == NULL!");
return false;
}
@@ -991,7 +991,7 @@ public class L2CharacterAI extends AbstractAI
// Get the distance between the current position of the L2Character and the target (x,y)
if (target == null)
{
_log.warning("maybeMoveToPawn: target == NULL!");
LOGGER.warning("maybeMoveToPawn: target == NULL!");
return false;
}
if (offset < 0)

View File

@@ -30,9 +30,9 @@ import com.l2jmobius.gameserver.model.skills.Skill;
*/
public class L2DoorAI extends L2CharacterAI
{
public L2DoorAI(L2DoorInstance creature)
public L2DoorAI(L2DoorInstance door)
{
super(creature);
super(door);
}
@Override

View File

@@ -32,12 +32,9 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
*/
public abstract class L2PlayableAI extends L2CharacterAI
{
/**
* @param creature the creature
*/
public L2PlayableAI(L2Playable creature)
public L2PlayableAI(L2Playable playable)
{
super(creature);
super(playable);
}
@Override
@@ -84,7 +81,7 @@ public abstract class L2PlayableAI extends L2CharacterAI
@Override
protected void onIntentionCast(Skill skill, L2Object target)
{
if ((target instanceof L2Playable) && skill.isBad())
if ((target.isPlayable()) && skill.isBad())
{
if (target.getActingPlayer().isProtectionBlessingAffected() && ((_actor.getActingPlayer().getLevel() - target.getActingPlayer().getLevel()) >= 10) && (_actor.getActingPlayer().getKarma() > 0) && !target.isInsideZone(ZoneId.PVP))
{

View File

@@ -39,11 +39,11 @@ public class L2PlayerAI extends L2PlayableAI
{
private boolean _thinking; // to prevent recursive thinking
private IntentionCommand _nextIntention = null;
IntentionCommand _nextIntention = null;
public L2PlayerAI(L2PcInstance creature)
public L2PlayerAI(L2PcInstance player)
{
super(creature);
super(player);
}
void saveNextIntention(CtrlIntention intention, Object arg0, Object arg1)

View File

@@ -28,11 +28,11 @@ public abstract class L2VehicleAI extends L2CharacterAI
{
/**
* Simple AI for vehicles
* @param creature
* @param vehicle
*/
public L2VehicleAI(L2Vehicle creature)
public L2VehicleAI(L2Vehicle vehicle)
{
super(creature);
super(vehicle);
}
@Override

View File

@@ -34,7 +34,7 @@ import com.l2jmobius.gameserver.util.Util;
*/
public class HtmCache
{
private static final Logger _log = Logger.getLogger(HtmCache.class.getName());
private static final Logger LOGGER = Logger.getLogger(HtmCache.class.getName());
private static final HTMLFilter HTML_FILTER = new HTMLFilter();
@@ -57,23 +57,23 @@ public class HtmCache
{
if (!Config.LAZY_CACHE)
{
_log.info("Html cache start...");
LOGGER.info("Html cache start...");
parseDir(f);
_log.info("Cache[HTML]: " + String.format("%.3f", getMemoryUsage()) + " megabytes on " + getLoadedFiles() + " files loaded");
LOGGER.info("Cache[HTML]: " + String.format("%.3f", getMemoryUsage()) + " megabytes on " + getLoadedFiles() + " files loaded");
}
else
{
_cache.clear();
_loadedFiles = 0;
_bytesBuffLen = 0;
_log.info("Cache[HTML]: Running lazy cache");
LOGGER.info("Cache[HTML]: Running lazy cache");
}
}
public void reloadPath(File f)
{
parseDir(f);
_log.info("Cache[HTML]: Reloaded specified path.");
LOGGER.info("Cache[HTML]: Reloaded specified path.");
}
public double getMemoryUsage()
@@ -137,7 +137,7 @@ public class HtmCache
}
catch (Exception e)
{
_log.log(Level.WARNING, "Problem with htm file " + e.getMessage(), e);
LOGGER.log(Level.WARNING, "Problem with htm file " + e.getMessage(), e);
}
return content;
}
@@ -148,7 +148,7 @@ public class HtmCache
if (content == null)
{
content = "<html><body>My text is missing:<br>" + path + "</body></html>";
_log.warning("Cache[HTML]: Missing HTML page: " + path);
LOGGER.warning("Cache[HTML]: Missing HTML page: " + path);
}
return content;
}

View File

@@ -19,10 +19,10 @@ package com.l2jmobius.gameserver.communitybbs.BB;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -30,9 +30,9 @@ import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
import com.l2jmobius.gameserver.communitybbs.Manager.TopicBBSManager;
public final class Forum
public class Forum
{
private static final Logger _log = Logger.getLogger(Forum.class.getName());
private static final Logger LOGGER = Logger.getLogger(Forum.class.getName());
// type
public static final int ROOT = 0;
@@ -46,7 +46,7 @@ public final class Forum
public static final int CLANMEMBERONLY = 2;
public static final int OWNERONLY = 3;
private final List<Forum> _children = new ArrayList<>();
private final List<Forum> _children;
private final Map<Integer, Topic> _topic = new ConcurrentHashMap<>();
private final int _forumId;
private String _forumName;
@@ -66,6 +66,7 @@ public final class Forum
{
_forumId = Forumid;
_fParent = FParent;
_children = new CopyOnWriteArrayList<>();
}
/**
@@ -84,6 +85,7 @@ public final class Forum
_forumPerm = perm;
_fParent = parent;
_ownerID = OwnerID;
_children = new CopyOnWriteArrayList<>();
parent._children.add(this);
ForumsBBSManager.getInstance().addForum(this);
_loaded = true;
@@ -109,7 +111,7 @@ public final class Forum
}
catch (Exception e)
{
_log.log(Level.WARNING, "Data error on Forum " + _forumId + " : " + e.getMessage(), e);
LOGGER.log(Level.WARNING, "Data error on Forum " + _forumId + " : " + e.getMessage(), e);
}
try (Connection con = DatabaseFactory.getInstance().getConnection();
@@ -131,7 +133,7 @@ public final class Forum
}
catch (Exception e)
{
_log.log(Level.WARNING, "Data error on Forum " + _forumId + " : " + e.getMessage(), e);
LOGGER.log(Level.WARNING, "Data error on Forum " + _forumId + " : " + e.getMessage(), e);
}
}
@@ -153,7 +155,7 @@ public final class Forum
}
catch (Exception e)
{
_log.log(Level.WARNING, "Data error on Forum (children): " + e.getMessage(), e);
LOGGER.log(Level.WARNING, "Data error on Forum (children): " + e.getMessage(), e);
}
}
@@ -229,18 +231,17 @@ public final class Forum
}
catch (Exception e)
{
_log.log(Level.WARNING, "Error while saving new Forum to db " + e.getMessage(), e);
LOGGER.log(Level.WARNING, "Error while saving new Forum to db " + e.getMessage(), e);
}
}
public void vload()
{
if (_loaded)
if (!_loaded)
{
return;
load();
getChildren();
_loaded = true;
}
load();
getChildren();
_loaded = true;
}
}

View File

@@ -19,8 +19,8 @@ package com.l2jmobius.gameserver.communitybbs.BB;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -32,7 +32,7 @@ import com.l2jmobius.gameserver.communitybbs.Manager.PostBBSManager;
*/
public class Post
{
private static final Logger _log = Logger.getLogger(Post.class.getName());
private static Logger LOGGER = Logger.getLogger(Post.class.getName());
public static class CPost
{
@@ -45,7 +45,7 @@ public class Post
public String postTxt;
}
private final List<CPost> _post = new ArrayList<>();
private final List<CPost> _post;
/**
* @param _PostOwner
@@ -57,6 +57,7 @@ public class Post
*/
public Post(String _PostOwner, int _PostOwnerID, long date, int tid, int _PostForumID, String txt)
{
_post = new CopyOnWriteArrayList<>();
final CPost cp = new CPost();
cp.postId = 0;
cp.postOwner = _PostOwner;
@@ -69,11 +70,6 @@ public class Post
insertindb(cp);
}
public Post(Topic t)
{
load(t);
}
public void insertindb(CPost cp)
{
try (Connection con = DatabaseFactory.getInstance().getConnection();
@@ -90,13 +86,27 @@ public class Post
}
catch (Exception e)
{
_log.log(Level.WARNING, "Error while saving new Post to db " + e.getMessage(), e);
LOGGER.log(Level.WARNING, "Error while saving new Post to db " + e.getMessage(), e);
}
}
public Post(Topic t)
{
_post = new CopyOnWriteArrayList<>();
load(t);
}
public CPost getCPost(int id)
{
return _post.get(id);
int i = 0;
for (CPost cp : _post)
{
if (i++ == id)
{
return cp;
}
}
return null;
}
public void deleteme(Topic t)
@@ -111,7 +121,7 @@ public class Post
}
catch (Exception e)
{
_log.log(Level.WARNING, "Error while deleting post: " + e.getMessage(), e);
LOGGER.log(Level.WARNING, "Error while deleting post: " + e.getMessage(), e);
}
}
@@ -143,7 +153,7 @@ public class Post
}
catch (Exception e)
{
_log.log(Level.WARNING, "Data error on Post " + t.getForumID() + "/" + t.getID() + " : " + e.getMessage(), e);
LOGGER.log(Level.WARNING, "Data error on Post " + t.getForumID() + "/" + t.getID() + " : " + e.getMessage(), e);
}
}
@@ -152,10 +162,10 @@ public class Post
*/
public void updatetxt(int i)
{
final CPost cp = getCPost(i);
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE posts SET post_txt=? WHERE post_id=? AND post_topic_id=? AND post_forum_id=?"))
{
final CPost cp = getCPost(i);
ps.setString(1, cp.postTxt);
ps.setInt(2, cp.postId);
ps.setInt(3, cp.postTopicId);
@@ -164,7 +174,7 @@ public class Post
}
catch (Exception e)
{
_log.log(Level.WARNING, "Error while saving new Post to db " + e.getMessage(), e);
LOGGER.log(Level.WARNING, "Error while saving new Post to db " + e.getMessage(), e);
}
}
}

View File

@@ -26,7 +26,7 @@ import com.l2jmobius.gameserver.communitybbs.Manager.TopicBBSManager;
public class Topic
{
private static final Logger _log = Logger.getLogger(Topic.class.getName());
private static final Logger LOGGER = Logger.getLogger(Topic.class.getName());
public static final int MORMAL = 0;
public static final int MEMO = 1;
@@ -86,7 +86,7 @@ public class Topic
}
catch (Exception e)
{
_log.log(Level.WARNING, "Error while saving new Topic to db " + e.getMessage(), e);
LOGGER.log(Level.WARNING, "Error while saving new Topic to db " + e.getMessage(), e);
}
}
@@ -138,7 +138,7 @@ public class Topic
}
catch (Exception e)
{
_log.log(Level.WARNING, "Error while deleting topic: " + e.getMessage(), e);
LOGGER.log(Level.WARNING, "Error while deleting topic: " + e.getMessage(), e);
}
}

View File

@@ -56,7 +56,7 @@ public abstract class BaseBBSManager
*/
protected void send1002(L2PcInstance activeChar, String string, String string2, String string3)
{
final List<String> _arg = new ArrayList<>();
final List<String> _arg = new ArrayList<>(20);
_arg.add("0");
_arg.add("0");
_arg.add("0");

View File

@@ -31,7 +31,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
public class ForumsBBSManager extends BaseBBSManager
{
private static Logger _log = Logger.getLogger(ForumsBBSManager.class.getName());
private final List<Forum> _table = new CopyOnWriteArrayList<>();
private final List<Forum> _table;
private int _lastid = 1;
/**
@@ -39,6 +39,7 @@ public class ForumsBBSManager extends BaseBBSManager
*/
protected ForumsBBSManager()
{
_table = new CopyOnWriteArrayList<>();
try (Connection con = DatabaseFactory.getInstance().getConnection();
Statement s = con.createStatement();
ResultSet rs = s.executeQuery("SELECT forum_id FROM forums WHERE forum_type = 0"))
@@ -50,7 +51,7 @@ public class ForumsBBSManager extends BaseBBSManager
}
catch (Exception e)
{
_log.log(Level.WARNING, "Data error on Forum (root): " + e.getMessage(), e);
_log.log(Level.WARNING, getClass().getSimpleName() + ": Data error on Forum (root): " + e.getMessage(), e);
}
}
@@ -60,7 +61,7 @@ public class ForumsBBSManager extends BaseBBSManager
public void initRoot()
{
_table.forEach(f -> f.vload());
_log.info("Loaded " + _table.size() + " forums. Last forum id used: " + _lastid);
_log.info(getClass().getSimpleName() + ": Loaded " + _table.size() + " forums. Last forum id used: " + _lastid);
}
/**
@@ -94,7 +95,14 @@ public class ForumsBBSManager extends BaseBBSManager
*/
public Forum getForumByName(String name)
{
return _table.stream().filter(f -> f.getName().equals(name)).findFirst().orElse(null);
for (Forum f : _table)
{
if (f.getName().equals(name))
{
return f;
}
}
return null;
}
/**
@@ -129,7 +137,14 @@ public class ForumsBBSManager extends BaseBBSManager
*/
public Forum getForumByID(int idf)
{
return _table.stream().filter(f -> f.getID() == idf).findFirst().orElse(null);
for (Forum f : _table)
{
if (f.getID() == idf)
{
return f;
}
}
return null;
}
@Override

View File

@@ -89,21 +89,14 @@ public class PostBBSManager extends BaseBBSManager
private void showEditPost(Topic topic, Forum forum, L2PcInstance activeChar, int idp)
{
if (topic == null)
final Post p = getGPosttByTopic(topic);
if ((forum == null) || (topic == null) || (p == null))
{
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>Error: This topic does not exist!</center></body></html>", activeChar);
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>Error, this forum, topic or post does not exist!</center><br><br></body></html>", activeChar);
}
else
{
final Post p = getGPosttByTopic(topic);
if ((forum == null) || (p == null))
{
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>Error: This forum or post does not exist!</center></body></html>", activeChar);
}
else
{
showHtmlEditPost(topic, activeChar, forum, p);
}
showHtmlEditPost(topic, activeChar, forum, p);
}
}
@@ -132,10 +125,9 @@ public class PostBBSManager extends BaseBBSManager
private void showMemoPost(Topic topic, L2PcInstance activeChar, Forum forum)
{
//
Post p = getGPosttByTopic(topic);
Locale locale = Locale.getDefault();
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, locale);
final Post p = getGPosttByTopic(topic);
final Locale locale = Locale.getDefault();
final DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, locale);
String mes = p.getCPost(0).postTxt.replace(">", "&gt;");
mes = mes.replace("<", "&lt;");

View File

@@ -19,10 +19,10 @@ package com.l2jmobius.gameserver.communitybbs.Manager;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.gameserver.communitybbs.BB.Forum;
@@ -35,7 +35,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
public class TopicBBSManager extends BaseBBSManager
{
private final List<Topic> _table = new CopyOnWriteArrayList<>();
private final Map<Forum, Integer> _maxId = new HashMap<>();
private final Map<Forum, Integer> _maxId = new ConcurrentHashMap<>();
protected TopicBBSManager()
{
@@ -244,7 +244,7 @@ public class TopicBBSManager extends BaseBBSManager
{
break;
}
Topic t = forum.getTopic(j);
final Topic t = forum.getTopic(j);
if (t != null)
{
if (i++ >= (12 * (index - 1)))

View File

@@ -52,19 +52,21 @@ public class CharNameTable
public final void addName(L2PcInstance player)
{
if (player == null)
if (player != null)
{
return;
addName(player.getObjectId(), player.getName());
_accessLevels.put(player.getObjectId(), player.getAccessLevel().getLevel());
}
addName(player.getObjectId(), player.getName());
_accessLevels.put(player.getObjectId(), player.getAccessLevel().getLevel());
}
private final void addName(int objectId, String name)
{
if ((name != null) && !name.equals(_chars.get(objectId)))
if (name != null)
{
_chars.put(objectId, name);
if (!name.equals(_chars.get(objectId)))
{
_chars.put(objectId, name);
}
}
}
@@ -105,8 +107,8 @@ public class CharNameTable
{
while (rs.next())
{
id = rs.getInt(1);
accessLevel = rs.getInt(2);
id = rs.getInt("charId");
accessLevel = rs.getInt("accesslevel");
}
}
}
@@ -115,14 +117,14 @@ public class CharNameTable
_log.log(Level.WARNING, getClass().getSimpleName() + ": Could not check existing char name: " + e.getMessage(), e);
}
if (id <= 0)
if (id > 0)
{
return -1; // not found
_chars.put(id, name);
_accessLevels.put(id, accessLevel);
return id;
}
_chars.put(id, name);
_accessLevels.put(id, accessLevel);
return id;
return -1; // not found
}
public final String getNameById(int id)
@@ -151,9 +153,9 @@ public class CharNameTable
{
if (rset.next())
{
name = rset.getString(1);
name = rset.getString("char_name");
_chars.put(id, name);
_accessLevels.put(id, rset.getInt(2));
_accessLevels.put(id, rset.getInt("accesslevel"));
return name;
}
}
@@ -173,14 +175,17 @@ public class CharNameTable
public synchronized boolean doesCharNameExist(String name)
{
boolean result = true;
boolean result = false;
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("SELECT account_name FROM characters WHERE char_name=?"))
PreparedStatement ps = con.prepareStatement("SELECT COUNT(*) as count FROM characters WHERE char_name=?"))
{
ps.setString(1, name);
try (ResultSet rs = ps.executeQuery())
{
result = rs.next();
if (rs.next())
{
result = rs.getInt("count") > 0;
}
}
}
catch (SQLException e)
@@ -193,20 +198,20 @@ public class CharNameTable
public int getAccountCharacterCount(String account)
{
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("SELECT COUNT(char_name) FROM characters WHERE account_name=?"))
PreparedStatement ps = con.prepareStatement("SELECT COUNT(char_name) as count FROM characters WHERE account_name=?"))
{
ps.setString(1, account);
try (ResultSet rset = ps.executeQuery())
{
while (rset.next())
if (rset.next())
{
return rset.getInt(1);
return rset.getInt("count");
}
}
}
catch (SQLException e)
{
_log.log(Level.WARNING, getClass().getSimpleName() + ": Could not check existing char count: " + e.getMessage(), e);
_log.log(Level.WARNING, "Couldn't retrieve account for id: " + e.getMessage(), e);
}
return 0;
}
@@ -219,14 +224,14 @@ public class CharNameTable
{
while (rs.next())
{
final int id = rs.getInt(1);
_chars.put(id, rs.getString(2));
_accessLevels.put(id, rs.getInt(3));
final int id = rs.getInt("charId");
_chars.put(id, rs.getString("char_name"));
_accessLevels.put(id, rs.getInt("accesslevel"));
}
}
catch (SQLException e)
{
_log.log(Level.WARNING, getClass().getSimpleName() + ": Could not load char name: " + e.getMessage(), e);
_log.log(Level.WARNING, getClass().getSimpleName() + ": Couldn't retrieve all char id/name/access: " + e.getMessage(), e);
}
_log.info(getClass().getSimpleName() + ": Loaded " + _chars.size() + " char names.");
}

View File

@@ -29,7 +29,7 @@ import com.l2jmobius.Config;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.data.xml.impl.PetDataTable;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.L2PetData;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;

View File

@@ -67,7 +67,7 @@ import com.l2jmobius.gameserver.util.Util;
*/
public class ClanTable
{
private static final Logger _log = Logger.getLogger(ClanTable.class.getName());
private static final Logger LOGGER = Logger.getLogger(ClanTable.class.getName());
private final Map<Integer, L2Clan> _clans = new ConcurrentHashMap<>();
protected ClanTable()
@@ -99,9 +99,9 @@ public class ClanTable
}
catch (Exception e)
{
_log.log(Level.SEVERE, "Error restoring ClanTable.", e);
LOGGER.log(Level.SEVERE, "Error restoring ClanTable.", e);
}
_log.info(getClass().getSimpleName() + ": Restored " + clanCount + " clans from the database.");
LOGGER.info(getClass().getSimpleName() + ": Restored " + clanCount + " clans from the database.");
allianceCheck();
restorewars();
}
@@ -331,7 +331,7 @@ public class ClanTable
}
catch (Exception e)
{
_log.log(Level.SEVERE, getClass().getSimpleName() + ": Error removing clan from DB.", e);
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Error removing clan from DB.", e);
}
// Notify to scripts
@@ -387,7 +387,7 @@ public class ClanTable
}
catch (Exception e)
{
_log.log(Level.SEVERE, getClass().getSimpleName() + ": Error storing clan wars data.", e);
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Error storing clan wars data.", e);
}
// SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.WAR_WITH_THE_S1_CLAN_HAS_BEGUN);
@@ -425,7 +425,7 @@ public class ClanTable
}
catch (Exception e)
{
_log.log(Level.SEVERE, getClass().getSimpleName() + ": Error removing clan wars data.", e);
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Error removing clan wars data.", e);
}
// SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.WAR_WITH_THE_S1_CLAN_HAS_ENDED);
@@ -473,13 +473,13 @@ public class ClanTable
}
else
{
_log.log(Level.WARNING, getClass().getSimpleName() + ": restorewars one of clans is null clan1:" + clan1 + " clan2:" + clan2);
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": restorewars one of clans is null clan1:" + clan1 + " clan2:" + clan2);
}
}
}
catch (Exception e)
{
_log.log(Level.SEVERE, getClass().getSimpleName() + ": Error restoring clan wars data.", e);
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Error restoring clan wars data.", e);
}
}
@@ -497,7 +497,7 @@ public class ClanTable
clan.setAllyName(null);
clan.changeAllyCrest(0, true);
clan.updateClanInDB();
_log.info(getClass().getSimpleName() + ": Removed alliance from clan: " + clan);
LOGGER.info(getClass().getSimpleName() + ": Removed alliance from clan: " + clan);
}
}
}
@@ -518,11 +518,11 @@ public class ClanTable
return clanAllies;
}
public void storeClanScore()
public void shutdown()
{
for (L2Clan clan : _clans.values())
{
clan.updateClanScoreInDB();
clan.updateInDB();
}
}

View File

@@ -36,7 +36,6 @@ import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.enums.AISkillScope;
import com.l2jmobius.gameserver.enums.DropType;
import com.l2jmobius.gameserver.model.StatsSet;

View File

@@ -28,7 +28,6 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
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;
@@ -106,7 +105,7 @@ public class PetSkillData implements IGameXmlReader
{
continue;
}
if (skillHolder.getSkillLvl() == 0)
if (skillHolder.getSkillLevel() == 0)
{
if (pet.getLevel() < 70)
{
@@ -131,9 +130,9 @@ public class PetSkillData implements IGameXmlReader
}
else if (1 <= pet.getLevel())
{
if (skillHolder.getSkillLvl() > lvl)
if (skillHolder.getSkillLevel() > lvl)
{
lvl = skillHolder.getSkillLvl();
lvl = skillHolder.getSkillLevel();
}
}
}

View File

@@ -14,7 +14,7 @@
* 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.gameserver.datatables;
package com.l2jmobius.gameserver.data.xml.impl;
import java.util.HashMap;
import java.util.HashSet;
@@ -22,7 +22,6 @@ import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
import com.l2jmobius.gameserver.engines.DocumentEngine;
import com.l2jmobius.gameserver.model.skills.Skill;

View File

@@ -34,7 +34,6 @@ import org.w3c.dom.Node;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2SkillLearn;

View File

@@ -38,6 +38,7 @@ import org.xml.sax.helpers.DefaultHandler;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -95,7 +96,7 @@ public final class BotReportTable
}
catch (Exception e)
{
LOGGER.log(Level.WARNING, "BotReportTable: Could not load punishments from /config/BotReportPunishments.xml", e);
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Could not load punishments from /config/BotReportPunishments.xml", e);
}
loadReportedCharData();
@@ -130,7 +131,6 @@ public final class BotReportTable
}
catch (Exception e)
{
}
while (rset.next())
@@ -165,11 +165,11 @@ public final class BotReportTable
}
}
LOGGER.info("BotReportTable: Loaded " + _reports.size() + " bot reports");
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _reports.size() + " bot reports");
}
catch (Exception e)
{
LOGGER.log(Level.WARNING, "BotReportTable: Could not load reported char data!", e);
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Could not load reported char data!", e);
}
}
@@ -187,19 +187,18 @@ public final class BotReportTable
for (Map.Entry<Integer, ReportedCharData> entrySet : _reports.entrySet())
{
final Map<Integer, Long> reportTable = entrySet.getValue()._reporters;
for (int reporterId : reportTable.keySet())
for (int reporterId : entrySet.getValue()._reporters.keySet())
{
ps.setInt(1, entrySet.getKey());
ps.setInt(2, reporterId);
ps.setLong(3, reportTable.get(reporterId));
ps.setLong(3, entrySet.getValue()._reporters.get(reporterId));
ps.execute();
}
}
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "BotReportTable: Could not update reported char data in database!", e);
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not update reported char data in database!", e);
}
}
@@ -211,7 +210,6 @@ public final class BotReportTable
public boolean reportBot(L2PcInstance reporter)
{
final L2Object target = reporter.getTarget();
if (target == null)
{
return false;
@@ -321,11 +319,11 @@ public final class BotReportTable
}
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_WAS_REPORTED_AS_A_BOT);
sm.addCharName(bot);
sm.addString(bot.getName());
reporter.sendPacket(sm);
sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_USED_A_REPORT_POINT_ON_C1_YOU_HAVE_S2_POINTS_REMAINING_ON_THIS_ACCOUNT);
sm.addCharName(bot);
sm.addString(bot.getName());
sm.addInt(rcdRep.getPointsLeft());
reporter.sendPacket(sm);
@@ -391,7 +389,7 @@ public final class BotReportTable
}
else
{
LOGGER.warning("BotReportTable: Could not add punishment for " + neededReports + " report(s): Skill " + skillId + "-" + skillLevel + " does not exist!");
LOGGER.warning(getClass().getSimpleName() + ": Could not add punishment for " + neededReports + " report(s): Skill " + skillId + "-" + skillLevel + " does not exist!");
}
}
@@ -427,7 +425,7 @@ public final class BotReportTable
catch (Exception e)
{
ThreadPool.schedule(new ResetPointTask(), 24 * 3600 * 1000);
LOGGER.log(Level.WARNING, "BotReportTable: Could not properly schedule bot report points reset task. Scheduled in 24 hours.", e);
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Could not properly schedule bot report points reset task. Scheduled in 24 hours.", e);
}
}

View File

@@ -16,9 +16,10 @@
*/
package com.l2jmobius.gameserver.datatables;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.gameserver.script.DateRange;
import com.l2jmobius.gameserver.script.EventDrop;
@@ -34,7 +35,7 @@ public class EventDroplist
/**
* The table containing all DataDrop object
*/
private static final List<DateDrop> ALL_NPC_DATE_DROPS = new ArrayList<>();
private static final List<DateDrop> ALL_NPC_DATE_DROPS = new CopyOnWriteArrayList<>();
public static class DateDrop
{
@@ -103,7 +104,7 @@ public class EventDroplist
*/
public List<DateDrop> getAllDrops()
{
final List<DateDrop> list = new ArrayList<>();
final List<DateDrop> list = new LinkedList<>();
final Date currentDate = new Date();
for (DateDrop drop : ALL_NPC_DATE_DROPS)
{

Some files were not shown because too many files have changed in this diff Show More