CLAN NAME ", cl.getName(), " CLAN LEVEL ", String.valueOf(cl.getLevel()), " CLAN MEMBERS ", String.valueOf(cl.getMembersCount()), " CLAN LEADER ", cl.getLeaderName(), " " +
+ final String html = Arrays.asList("CLAN NAME ", cl.getName(), " CLAN LEVEL ", String.valueOf(cl.getLevel()), " CLAN MEMBERS ", String.valueOf(cl.getMembersCount()), " CLAN LEADER ", cl.getLeaderName(), " " +
// ADMINISTRATOR ??
/*
* html.append(""); html.append("ADMINISTRATOR "); html.append(""+cl.getLeaderName()+" "); html.append(" ");
@@ -270,7 +298,7 @@ public class ClanBoard implements IWriteBoardHandler
"ALLIANCE ", (cl.getAllyName() != null) ? cl.getAllyName() : "", "
" +
// TODO: the BB for clan :)
// html.append("");
- " ");
+ " ").stream().collect(Collectors.joining());
CommunityBoardHandler.separateAndSend(html, activeChar);
}
}
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java b/L2J_Mobius_Test/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
index b9d67dc6a7..734cf3ff1d 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/handlers/usercommandhandlers/ClanPenalty.java
@@ -21,7 +21,6 @@ import java.text.SimpleDateFormat;
import com.l2jmobius.gameserver.handler.IUserCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
-import com.l2jmobius.util.StringUtil;
/**
* Clan Penalty user command.
@@ -43,24 +42,31 @@ public class ClanPenalty implements IUserCommandHandler
}
boolean penalty = false;
- final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
- final StringBuilder htmlContent = StringUtil.startAppend(500, "");
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+ final StringBuilder htmlContent = new StringBuilder(500);
+ htmlContent.append("");
if (activeChar.getClanJoinExpiryTime() > System.currentTimeMillis())
{
- StringUtil.append(htmlContent, "Unable to join a clan. ", format.format(activeChar.getClanJoinExpiryTime()), " ");
+ htmlContent.append("Unable to join a clan. ");
+ htmlContent.append(format.format(activeChar.getClanJoinExpiryTime()));
+ htmlContent.append(" ");
penalty = true;
}
if (activeChar.getClanCreateExpiryTime() > System.currentTimeMillis())
{
- StringUtil.append(htmlContent, "Unable to create a clan. ", format.format(activeChar.getClanCreateExpiryTime()), " ");
+ htmlContent.append("Unable to create a clan. ");
+ htmlContent.append(format.format(activeChar.getClanCreateExpiryTime()));
+ htmlContent.append(" ");
penalty = true;
}
if ((activeChar.getClan() != null) && (activeChar.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
{
- StringUtil.append(htmlContent, "Unable to invite a clan member. ", format.format(activeChar.getClan().getCharPenaltyExpiryTime()), " ");
+ htmlContent.append("Unable to invite a clan member. ");
+ htmlContent.append(format.format(activeChar.getClan().getCharPenaltyExpiryTime()));
+ htmlContent.append(" ");
penalty = true;
}
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/handlers/voicedcommandhandlers/Lang.java b/L2J_Mobius_Test/dist/game/data/scripts/handlers/voicedcommandhandlers/Lang.java
index 551691bced..7b03138395 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/handlers/voicedcommandhandlers/Lang.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/handlers/voicedcommandhandlers/Lang.java
@@ -22,7 +22,6 @@ import com.l2jmobius.Config;
import com.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
-import com.l2jmobius.util.StringUtil;
public class Lang implements IVoicedCommandHandler
{
@@ -42,10 +41,10 @@ public class Lang implements IVoicedCommandHandler
final NpcHtmlMessage msg = new NpcHtmlMessage();
if (params == null)
{
- final StringBuilder html = StringUtil.startAppend(100);
+ final StringBuilder html = new StringBuilder(100);
for (String lang : Config.L2JMOD_MULTILANG_ALLOWED)
{
- StringUtil.append(html, " ");
+ html.append(" ");
}
msg.setFile(activeChar.getHtmlPrefix(), "html/mods/Lang/LanguageSelect.htm");
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/handlers/voicedcommandhandlers/StatsVCmd.java b/L2J_Mobius_Test/dist/game/data/scripts/handlers/voicedcommandhandlers/StatsVCmd.java
index b73e079ef9..42e8370b23 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/handlers/voicedcommandhandlers/StatsVCmd.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/handlers/voicedcommandhandlers/StatsVCmd.java
@@ -23,7 +23,6 @@ import com.l2jmobius.gameserver.model.entity.L2Event;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
-import com.l2jmobius.util.StringUtil;
/**
* @author Zoey76.
@@ -65,10 +64,11 @@ public class StatsVCmd implements IVoicedCommandHandler
return false;
}
- final StringBuilder replyMSG = StringUtil.startAppend(300 + (pc.getEventStatus().getKills().size() * 50), "[ L2J EVENT ENGINE ] Statistics for player ", pc.getName(), " Total kills ", String.valueOf(pc.getEventStatus().getKills().size()), " Detailed list: ");
+ final StringBuilder replyMSG = new StringBuilder(300 + (pc.getEventStatus().getKills().size() * 50));
+ replyMSG.append("[ L2J EVENT ENGINE ] Statistics for player " + pc.getName() + " Total kills " + pc.getEventStatus().getKills().size() + " Detailed list: ");
for (L2PcInstance plr : pc.getEventStatus().getKills())
{
- StringUtil.append(replyMSG, "", plr.getName(), " ");
+ replyMSG.append("" + plr.getName() + " ");
}
replyMSG.append("");
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/instances/AbstractInstance.java b/L2J_Mobius_Test/dist/game/data/scripts/instances/AbstractInstance.java
index caf77c07db..e0f60e8f79 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/instances/AbstractInstance.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/instances/AbstractInstance.java
@@ -52,6 +52,11 @@ public abstract class AbstractInstance extends AbstractNpcAI
super(name, "instances");
}
+ protected void enterInstance(L2PcInstance player, String template, int templateId)
+ {
+ enterInstance(player, new InstanceWorld(), template, templateId);
+ }
+
protected void enterInstance(L2PcInstance player, InstanceWorld instance, String template, int templateId)
{
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/instances/ElcadiasTent/ElcadiasTent.java b/L2J_Mobius_Test/dist/game/data/scripts/instances/ElcadiasTent/ElcadiasTent.java
index 0d7254ac24..cebfc61c2a 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/instances/ElcadiasTent/ElcadiasTent.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/instances/ElcadiasTent/ElcadiasTent.java
@@ -44,10 +44,6 @@ public final class ElcadiasTent extends AbstractInstance
// Misc
private static final int TEMPLATE_ID = 158;
- class ETWorld extends InstanceWorld
- {
- }
-
public ElcadiasTent()
{
super(ElcadiasTent.class.getSimpleName());
@@ -71,7 +67,7 @@ public final class ElcadiasTent extends AbstractInstance
|| ((ForbiddenBook != null) && ForbiddenBook.isCompleted() && (Monastery == null)) //
|| ((PowerOfSeal != null) && PowerOfSeal.isStarted()))
{
- enterInstance(talker, new ETWorld(), "ElcadiasTent.xml", TEMPLATE_ID);
+ enterInstance(talker, "ElcadiasTent.xml", TEMPLATE_ID);
}
else
{
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/instances/FaeronTrainingGrounds1/FaeronTrainingGrounds1.java b/L2J_Mobius_Test/dist/game/data/scripts/instances/FaeronTrainingGrounds1/FaeronTrainingGrounds1.java
index e91571fef9..a99726052c 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/instances/FaeronTrainingGrounds1/FaeronTrainingGrounds1.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/instances/FaeronTrainingGrounds1/FaeronTrainingGrounds1.java
@@ -43,10 +43,6 @@ public final class FaeronTrainingGrounds1 extends AbstractInstance
// Misc
private static final int TEMPLATE_ID = 251;
- class FTGWorld extends InstanceWorld
- {
- }
-
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
@@ -58,7 +54,7 @@ public final class FaeronTrainingGrounds1 extends AbstractInstance
if (event.equals("enter_instance"))
{
- enterInstance(player, new FTGWorld(), "FaeronTrainingGrounds1.xml", TEMPLATE_ID);
+ enterInstance(player, "FaeronTrainingGrounds1.xml", TEMPLATE_ID);
}
else if (event.equals("exit_instance"))
{
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/instances/FaeronTrainingGrounds2/FaeronTrainingGrounds2.java b/L2J_Mobius_Test/dist/game/data/scripts/instances/FaeronTrainingGrounds2/FaeronTrainingGrounds2.java
index 9d5c4e405c..54d074a39a 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/instances/FaeronTrainingGrounds2/FaeronTrainingGrounds2.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/instances/FaeronTrainingGrounds2/FaeronTrainingGrounds2.java
@@ -43,10 +43,6 @@ public final class FaeronTrainingGrounds2 extends AbstractInstance
// Misc
private static final int TEMPLATE_ID = 252;
- class FTGWorld extends InstanceWorld
- {
- }
-
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
@@ -58,7 +54,7 @@ public final class FaeronTrainingGrounds2 extends AbstractInstance
if (event.equals("enter_instance"))
{
- enterInstance(player, new FTGWorld(), "FaeronTrainingGrounds2.xml", TEMPLATE_ID);
+ enterInstance(player, "FaeronTrainingGrounds2.xml", TEMPLATE_ID);
}
else if (event.equals("exit_instance"))
{
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/instances/HarnakUndergroundRuins/HarnakUndergroundRuins.java b/L2J_Mobius_Test/dist/game/data/scripts/instances/HarnakUndergroundRuins/HarnakUndergroundRuins.java
index 804c480df9..c4a1798480 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/instances/HarnakUndergroundRuins/HarnakUndergroundRuins.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/instances/HarnakUndergroundRuins/HarnakUndergroundRuins.java
@@ -16,7 +16,6 @@
*/
package instances.HarnakUndergroundRuins;
-import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
@@ -45,6 +44,21 @@ import instances.AbstractInstance;
*/
public final class HarnakUndergroundRuins extends AbstractInstance
{
+ protected class HuRWorld extends InstanceWorld
+ {
+ protected int wave = 0;
+ protected int currentNpc = 0;
+ protected int waveNpcId = 0;
+ protected int maximalDefenseCounter = 0;
+ protected int timerCount = 0;
+ protected int enabledSeal = 0;
+ protected Set spawnedNpc = ConcurrentHashMap.newKeySet();
+ protected boolean openingPlayed = false;
+ protected boolean harnakMessage1 = false;
+ protected boolean harnakMessage2 = false;
+ protected boolean harnakMessage3 = false;
+ }
+
// NPCs
private static final int HADEL = 33344;
private static final int KRAKIA_BATHUS = 27437;
@@ -83,21 +97,6 @@ public final class HarnakUndergroundRuins extends AbstractInstance
private static final int DOOR_ONE = 16240100;
private static final int DOOR_TWO = 16240102;
- class HuRWorld extends InstanceWorld
- {
- int wave = 0;
- int currentNpc = 0;
- int waveNpcId = 0;
- int maximalDefenseCounter = 0;
- int timerCount = 0;
- int enabledSeal = 0;
- final Set spawnedNpc = Collections.newSetFromMap(new ConcurrentHashMap());
- boolean openingPlayed = false;
- boolean harnakMessage1 = false;
- boolean harnakMessage2 = false;
- boolean harnakMessage3 = false;
- }
-
public HarnakUndergroundRuins()
{
super(HarnakUndergroundRuins.class.getSimpleName());
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/instances/HideoutOfTheDawn/HideoutOfTheDawn.java b/L2J_Mobius_Test/dist/game/data/scripts/instances/HideoutOfTheDawn/HideoutOfTheDawn.java
index f290eab6d8..b4ba70be34 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/instances/HideoutOfTheDawn/HideoutOfTheDawn.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/instances/HideoutOfTheDawn/HideoutOfTheDawn.java
@@ -39,10 +39,6 @@ public final class HideoutOfTheDawn extends AbstractInstance
// Misc
private static final int TEMPLATE_ID = 113;
- class HotDWorld extends InstanceWorld
- {
- }
-
public HideoutOfTheDawn()
{
super(HideoutOfTheDawn.class.getSimpleName());
@@ -57,7 +53,7 @@ public final class HideoutOfTheDawn extends AbstractInstance
{
case WOOD:
{
- enterInstance(talker, new HotDWorld(), "HideoutOfTheDawn.xml", TEMPLATE_ID);
+ enterInstance(talker, "HideoutOfTheDawn.xml", TEMPLATE_ID);
return "32593-01.htm";
}
case JAINA:
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout1/JiniaGuildHideout1.java b/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout1/JiniaGuildHideout1.java
index d096b5bd34..b91028fa89 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout1/JiniaGuildHideout1.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout1/JiniaGuildHideout1.java
@@ -38,10 +38,6 @@ public final class JiniaGuildHideout1 extends AbstractInstance
// Misc
private static final int TEMPLATE_ID = 140;
- class JGH1World extends InstanceWorld
- {
- }
-
public JiniaGuildHideout1()
{
super(JiniaGuildHideout1.class.getSimpleName());
@@ -55,7 +51,7 @@ public final class JiniaGuildHideout1 extends AbstractInstance
final QuestState qs = talker.getQuestState(Q10284_AcquisitionOfDivineSword.class.getSimpleName());
if ((qs != null) && qs.isCond(1))
{
- enterInstance(talker, new JGH1World(), "JiniaGuildHideout1.xml", TEMPLATE_ID);
+ enterInstance(talker, "JiniaGuildHideout1.xml", TEMPLATE_ID);
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout2/JiniaGuildHideout2.java b/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout2/JiniaGuildHideout2.java
index 17b655120b..d71c492f31 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout2/JiniaGuildHideout2.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout2/JiniaGuildHideout2.java
@@ -38,10 +38,6 @@ public final class JiniaGuildHideout2 extends AbstractInstance
// Misc
private static final int TEMPLATE_ID = 141;
- class JGH2World extends InstanceWorld
- {
- }
-
public JiniaGuildHideout2()
{
super(JiniaGuildHideout2.class.getSimpleName());
@@ -55,7 +51,7 @@ public final class JiniaGuildHideout2 extends AbstractInstance
final QuestState qs = talker.getQuestState(Q10285_MeetingSirra.class.getSimpleName());
if ((qs != null) && qs.isMemoState(1))
{
- enterInstance(talker, new JGH2World(), "JiniaGuildHideout2.xml", TEMPLATE_ID);
+ enterInstance(talker, "JiniaGuildHideout2.xml", TEMPLATE_ID);
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout3/JiniaGuildHideout3.java b/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout3/JiniaGuildHideout3.java
index 033aa2596f..0d2d6ceb48 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout3/JiniaGuildHideout3.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout3/JiniaGuildHideout3.java
@@ -38,10 +38,6 @@ public final class JiniaGuildHideout3 extends AbstractInstance
// Misc
private static final int TEMPLATE_ID = 145;
- class JGH3World extends InstanceWorld
- {
- }
-
public JiniaGuildHideout3()
{
super(JiniaGuildHideout3.class.getSimpleName());
@@ -55,7 +51,7 @@ public final class JiniaGuildHideout3 extends AbstractInstance
final QuestState qs = talker.getQuestState(Q10286_ReunionWithSirra.class.getSimpleName());
if ((qs != null) && qs.isMemoState(1))
{
- enterInstance(talker, new JGH3World(), "JiniaGuildHideout3.xml", TEMPLATE_ID);
+ enterInstance(talker, "JiniaGuildHideout3.xml", TEMPLATE_ID);
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout4/JiniaGuildHideout4.java b/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout4/JiniaGuildHideout4.java
index 099a653f42..fee4996089 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout4/JiniaGuildHideout4.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/instances/JiniaGuildHideout4/JiniaGuildHideout4.java
@@ -38,10 +38,6 @@ public final class JiniaGuildHideout4 extends AbstractInstance
// Misc
private static final int TEMPLATE_ID = 146;
- class JGH4World extends InstanceWorld
- {
- }
-
public JiniaGuildHideout4()
{
super(JiniaGuildHideout4.class.getSimpleName());
@@ -55,7 +51,7 @@ public final class JiniaGuildHideout4 extends AbstractInstance
final QuestState qs = talker.getQuestState(Q10287_StoryOfThoseLeft.class.getSimpleName());
if ((qs != null) && qs.isMemoState(1))
{
- enterInstance(talker, new JGH4World(), "JiniaGuildHideout4.xml", TEMPLATE_ID);
+ enterInstance(talker, "JiniaGuildHideout4.xml", TEMPLATE_ID);
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/instances/PailakaSongOfIceAndFire/PailakaSongOfIceAndFire.java b/L2J_Mobius_Test/dist/game/data/scripts/instances/PailakaSongOfIceAndFire/PailakaSongOfIceAndFire.java
index 03b9fb5641..ec6cdb9481 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/instances/PailakaSongOfIceAndFire/PailakaSongOfIceAndFire.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/instances/PailakaSongOfIceAndFire/PailakaSongOfIceAndFire.java
@@ -51,10 +51,6 @@ public final class PailakaSongOfIceAndFire extends AbstractInstance
private static final int TEMPLATE_ID = 43;
private static final int ZONE = 20108;
- class PSoIWorld extends InstanceWorld
- {
- }
-
public PailakaSongOfIceAndFire()
{
super(PailakaSongOfIceAndFire.class.getSimpleName());
@@ -84,7 +80,7 @@ public final class PailakaSongOfIceAndFire extends AbstractInstance
{
case "enter":
{
- enterInstance(player, new PSoIWorld(), "PailakaSongOfIceAndFire.xml", TEMPLATE_ID);
+ enterInstance(player, "PailakaSongOfIceAndFire.xml", TEMPLATE_ID);
break;
}
case "GARGOS_LAUGH":
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32497-01.htm b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32497-01.htm
index cdcb7881b3..d5b764f211 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32497-01.htm
+++ b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32497-01.htm
@@ -2,5 +2,5 @@
What do you know about Pailaka? The Ivory Tower discovered it shortly after Kamaloka.
Apparently, it's a kind of "pocket reality" created by Kamaloka's energy acting on places that are filled with a high degree of chaos: old battlefields or the sites of powerful magical experiments, for example.
Although Pailaka is not part of our reality, what happens there can affect our world...
-Keep listening.
+"Ah... Please go on."
\ No newline at end of file
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32497-02.htm b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32497-02.htm
index 58441afba7..8c36dcf5ef 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32497-02.htm
+++ b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32497-02.htm
@@ -1,9 +1,8 @@
Inspector Adler:
-We inspectors were sent by the Ivory Tower to find more about that place.
-We followed the flow of mana and traced the energy of Kamaloka to find likely spots.
-At present, Pailaka has not affected our reality, but who knows what may happen in time? It may even impact next year's harvest.
-We discovered Pailaka in the Forgotten Temple close to here. If you are willing, I would like you to enter Pailaka and restore order. Will you do it?
-(You will be rewarded for your efforts. Vitality points will be granted to you immediately upon completing the quest. If you receive the reward while your Vitality Level is high, though, you may notice a slight reduction.)
-Say yes.
-Say no.
+The Ivory Tower sent our inspection team to find out what we could about the place.
+We followed the flow of mana, tracing the energy of Kamaloka to find likely spots to look.
+So far, it seems that Pailaka has not affected our reality, but who knows what may happen as time goes by? It might even impact next year's harvest!
+We found Pailaka, it's in the Forgotten Temple, very close to here. If you are willing, I'd like you to enter Pailaka and restore order. Can I trust you to do so?
+"Absolutely."
+Quest
\ No newline at end of file
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-00.htm b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-00.htm
index 2dd78fcea2..af6e5bdc57 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-00.htm
+++ b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-00.htm
@@ -1,3 +1,3 @@
-Inspector Adler:
+Investigator Adler:
It is time for you to use the Scroll of Escape I gave you.
\ No newline at end of file
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-01.htm b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-01.htm
index d3c87087da..fbf540071b 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-01.htm
+++ b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-01.htm
@@ -1,6 +1,17 @@
Inspector Adler:
-The Spirite's power is flowing smoothly. You have certainly justfield my trust in you!
-Thanks to you, we are rapidy restoring stability. Of course, that means the dimensional portal that connects your world to ours is also quickly closing.
-Hurry and take my hand! That sword belongs to this dimension, so you'd best leave it behind. Ah, I can see you'd rather keep it -- but such a powerful item may desrupt travel between dimensions!
-Take his hand.
+It seems I chose wisely when I asked you to take on this task. The power levels here are stabilizing.
+Thanks to you, the connection between our world and this other dimension is fading!
+Here, take my hand! And leave that sword behind! It belongs to this dimension and will block us from returning! You can have one of these fine weapons to replace it. Choose whichever you'd like, but hurry!
+Cursed Dagger
+Battle Axe
+StormBringer
+Dark Elven Dagger
+Crystal Staff
+Heavy Doom Axe
+Chakram
+Stick of Faith
+Skull Graver
+Crystallized Ice Bow
+Orcish Glaive
+Flamberge
\ No newline at end of file
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-02.htm b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-02.htm
index 997c7bed00..215dabcbd8 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-02.htm
+++ b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/32510-02.htm
@@ -1,3 +1,3 @@
-Inspector Adler:
-Please accept this Scroll of Escape. Its power will allow you to safely return to your world.
+Investigator Adler:
+A fine choice. Use it well. Also, take this Scroll of Escape. It should take you back to where you came from.
\ No newline at end of file
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/Q00128_PailakaSongOfIceAndFire.java b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/Q00128_PailakaSongOfIceAndFire.java
index eaf545c306..ead87f8fc0 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/Q00128_PailakaSongOfIceAndFire.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00128_PailakaSongOfIceAndFire/Q00128_PailakaSongOfIceAndFire.java
@@ -21,7 +21,6 @@ import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Instance;
-import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
@@ -59,17 +58,10 @@ public final class Q00128_PailakaSongOfIceAndFire extends Quest
private static final int HEAL_POTION = 13033;
private static final int FIRE_ENHANCER = 13040;
private static final int WATER_ENHANCER = 13041;
- private static final int[] REWARDS =
- {
- 13294, // Pailaka Ring
- 13293, // Pailaka Earring
- 736, // Scroll of Escape
- };
- // Skills
- private static SkillHolder VITALITY_REPLENISHING = new SkillHolder(5774, 1);
+ private static final int SCROLL_OF_ESCAPE = 736;
// Misc
- private static final int MIN_LEVEL = 36;
- private static final int MAX_LEVEL = 42;
+ private static final int MIN_LEVEL = 49;
+ private static final int MAX_LEVEL = 55;
private static final int EXIT_TIME = 5;
public Q00128_PailakaSongOfIceAndFire()
@@ -78,6 +70,8 @@ public final class Q00128_PailakaSongOfIceAndFire extends Quest
addStartNpc(ADLER1);
addTalkId(ADLER1, ADLER2, SINAI, INSPECTOR);
addKillId(HILLAS, PAPION, KINSUS, GARGOS, ADIANTUM);
+ addCondMinLevel(MIN_LEVEL, "32497-05.htm");
+ addCondMaxLevel(MAX_LEVEL, "32497-06.htm");
registerQuestItems(SWORD, ENH_SWORD1, ENH_SWORD2, BOOK1, BOOK2, BOOK3, BOOK4, BOOK5, BOOK6, BOOK7, WATER_ESSENCE, FIRE_ESSENCE, SHIELD_POTION, HEAL_POTION, FIRE_ENHANCER, WATER_ENHANCER);
}
@@ -152,25 +146,28 @@ public final class Q00128_PailakaSongOfIceAndFire extends Quest
}
break;
}
- case "32510-02.htm":
+ case "226": // Cursed Dagger
+ case "160": // Battle Axe
+ case "72": // StormBringer
+ case "232": // Dark Elven Dagger
+ case "192": // Crystal Staff
+ case "194": // Heavy Doom Axe
+ case "263": // Chakram
+ case "193": // Stick of Faith
+ case "173": // Skill Graver
+ case "281": // Crystallized Ice Bow
+ case "298": // Orcish Glaive
+ case "71": // Flamberge
{
- qs.exitQuest(false, true);
-
final Instance inst = InstanceManager.getInstance().getInstance(npc.getInstanceId());
inst.setDuration(EXIT_TIME * 60000);
inst.setEmptyDestroyTime(0);
-
- if (inst.containsPlayer(player.getObjectId()))
- {
- npc.setTarget(player);
- npc.doCast(VITALITY_REPLENISHING.getSkill());
- addExpAndSp(player, 810000, 50000);
- for (int id : REWARDS)
- {
- giveItems(player, id, 1);
- }
- }
- htmltext = event;
+ qs.exitQuest(false, true);
+ giveAdena(player, 187200, true);
+ addExpAndSp(player, 1860000, 446);
+ giveItems(player, SCROLL_OF_ESCAPE, 1);
+ giveItems(player, Integer.parseInt(event), 1);
+ htmltext = "32510-2.htm";
break;
}
}
@@ -195,18 +192,7 @@ public final class Q00128_PailakaSongOfIceAndFire extends Quest
{
case State.CREATED:
{
- if (player.getLevel() < MIN_LEVEL)
- {
- htmltext = "32497-05.htm";
- }
- else if (player.getLevel() > MAX_LEVEL)
- {
- htmltext = "32497-06.htm";
- }
- else
- {
- htmltext = "32497-01.htm";
- }
+ htmltext = "32497-01.htm";
break;
}
case State.STARTED:
diff --git a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/Q00129_PailakaDevilsLegacy.java b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/Q00129_PailakaDevilsLegacy.java
index f7142172b4..3aab84967e 100644
--- a/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/Q00129_PailakaDevilsLegacy.java
+++ b/L2J_Mobius_Test/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/Q00129_PailakaDevilsLegacy.java
@@ -21,7 +21,6 @@ import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Instance;
-import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
@@ -54,8 +53,6 @@ public final class Q00129_PailakaDevilsLegacy extends Quest
private static final int PAILAKA_KEY = 13150; // Pailaka All-Purpose Key
private static final int BRACELET = 13295; // Pailaka Bracelet
private static final int ESCAPE = 736; // Scroll of Escape
- // Skills
- private static final SkillHolder VITALITY_REPLENISHING = new SkillHolder(5774, 2); // Pailaka Reward Vitality Replenishing
// Misc
private static final int MIN_LEVEL = 61;
private static final int MAX_LEVEL = 67;
@@ -225,7 +222,6 @@ public final class Q00129_PailakaDevilsLegacy extends Quest
{
htmltext = "32508-00.htm";
}
-
break;
}
case ADVENTURER2:
@@ -242,9 +238,8 @@ public final class Q00129_PailakaDevilsLegacy extends Quest
inst.setEmptyDestroyTime(0);
if (inst.containsPlayer(player.getObjectId()))
{
- npc.setTarget(player);
- npc.doCast(VITALITY_REPLENISHING.getSkill());
- addExpAndSp(player, 10800000, 950000);
+ addExpAndSp(player, 4010000, 962);
+ giveAdena(player, 411500, true);
rewardItems(player, BRACELET, 1);
rewardItems(player, ESCAPE, 1);
}
diff --git a/L2J_Mobius_Test/dist/game/data/stats/skills/10000-10099.xml b/L2J_Mobius_Test/dist/game/data/stats/skills/10000-10099.xml
index 4cf55f2f1f..f7503c0017 100644
--- a/L2J_Mobius_Test/dist/game/data/stats/skills/10000-10099.xml
+++ b/L2J_Mobius_Test/dist/game/data/stats/skills/10000-10099.xml
@@ -1755,14 +1755,24 @@
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
+
@@ -2363,35 +2373,32 @@
+
-
+
+
-
-
-
-
-
-
-
-
+
+
-
-
+
-
+
+
-
-
+
-
-
+
+
+
+
diff --git a/L2J_Mobius_Test/dist/game/data/stats/skills/10200-10299.xml b/L2J_Mobius_Test/dist/game/data/stats/skills/10200-10299.xml
index 9606512954..295c7a3da8 100644
--- a/L2J_Mobius_Test/dist/game/data/stats/skills/10200-10299.xml
+++ b/L2J_Mobius_Test/dist/game/data/stats/skills/10200-10299.xml
@@ -1,36 +1,48 @@
+
-
+
-
-
-
-
+
+
+
-
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
@@ -39,14 +51,21 @@
-
+
+
+
+
+
+
+
+
@@ -600,107 +619,103 @@
-
-
+
+
+
+ -169 -170 -171 -172 -173 -174 -175 -176
+
+ 122 124 129 133 137 142 146 151
30 33 36 40 43 46 50 53 56 60
- 17545 17945 18344 18743 19142 19542 19941 20340 20739 21139 21545 27945 28344 28743 29142 29542 29941 30340 30739 31139
+ 17545 17945 18344 18743 19142 19542 19941 20340 20739 21139
144 138 132 126 120 114 108 102 96 90
- 85 86 88 90 92 94 96 98 101 103 105
- 98 98 98 98 98 99 99 99 99 99
- 11557 11956 12754 13533 14351 15155 15948 16747 17896 18622 19348
- 30 32 34 36 38 40 42 44 46 48 50
- 122 124 129 133 137 142 146 151 156 161 166
- 4900 4800 4700 4600 4500 4400 4300 4200 4100 4000
-
- 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
- 0.95 0.94 0.93 0.92 0.91 0.9 0.89 0.88 0.87 0.86 0.85 0.84 0.84 0.83 0.83 0.82 0.82 0.81 0.81 0.8
-
-
-
-
-
-
-
-
-
+
+ 11557 11956 12754 13533 14351 15155 15948 16747
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 91 87 83 79 76 72 68 64 60 57
- 61 62 63 64 65 66 67 68 69 70
- 85 87 88 91 93 95 97 99 101 103 105
- 0.99 0.98 0.97 0.96 0.95 0.94 0.93 0.92 0.91 0.90
- 3800 3900 4000 4100 4200 4300 4400 4500 4600 4700
- 76 79 81 84 87 90 92 95 98 101 104
- 119000 118000 117000 116000 115000 114000 113000 112000 111000 110000
- 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
- 0.95 0.94 0.93 0.92 0.91 0.9 0.89 0.88 0.87 0.86 0.85 0.84 0.84 0.83 0.83 0.82 0.82 0.81 0.81 0.8
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+ 91 87 83 79 76 72 68 64 60 57
+ 61 62 63 64 65 66 67 68 69 70
+
+ 0.99 0.98 0.97 0.96 0.95 0.94 0.93 0.92 0.91 0.90
+ 3800 3900 4000 4100 4200 4300 4400 4500 4600 4700
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -708,15 +723,17 @@
-
+
-
-
+
+
+
+
@@ -1874,12 +1891,16 @@
-
+
+
+
+
-
-
+
+
+
diff --git a/L2J_Mobius_Test/dist/game/data/stats/skills/10300-10399.xml b/L2J_Mobius_Test/dist/game/data/stats/skills/10300-10399.xml
index 3f4cb17f4e..dbf312d3f7 100644
--- a/L2J_Mobius_Test/dist/game/data/stats/skills/10300-10399.xml
+++ b/L2J_Mobius_Test/dist/game/data/stats/skills/10300-10399.xml
@@ -76,30 +76,36 @@
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
-
-
+
+
@@ -334,31 +340,36 @@
-
+
+
-
-
-
+
+
+
-
+
+
+
+
-
+
-
-
+
+
+
-
+
diff --git a/L2J_Mobius_Test/dist/game/data/stats/skills/11300-11399.xml b/L2J_Mobius_Test/dist/game/data/stats/skills/11300-11399.xml
index 889ac3c673..d9e4e11913 100644
--- a/L2J_Mobius_Test/dist/game/data/stats/skills/11300-11399.xml
+++ b/L2J_Mobius_Test/dist/game/data/stats/skills/11300-11399.xml
@@ -1055,11 +1055,23 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Test/dist/game/data/stats/skills/11700-11799.xml b/L2J_Mobius_Test/dist/game/data/stats/skills/11700-11799.xml
index 315fc8fb57..e63dba78e1 100644
--- a/L2J_Mobius_Test/dist/game/data/stats/skills/11700-11799.xml
+++ b/L2J_Mobius_Test/dist/game/data/stats/skills/11700-11799.xml
@@ -117,30 +117,67 @@
-
+
+
+
+
-
- 66 72 78 84 90 96 102 108 114 120
-
-
-
-
-
+
+
+ 101 102 103 104 105 106 107 108 109 110
+ 66 72 78 84 90 96 104 110 116 120
+ 660 720 780 840 900 960 1040 1100 1160 1200
+
+
+
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
-
+
+
-
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Test/dist/game/data/stats/skills/13000-13099.xml b/L2J_Mobius_Test/dist/game/data/stats/skills/13000-13099.xml
index 46903cd7a6..28b3d40f77 100644
--- a/L2J_Mobius_Test/dist/game/data/stats/skills/13000-13099.xml
+++ b/L2J_Mobius_Test/dist/game/data/stats/skills/13000-13099.xml
@@ -1171,31 +1171,29 @@
-
+
-
-
-
-
+
+
+
+
+
+
-
-
-
+
@@ -1205,294 +1203,251 @@
-
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
+
+
-
+
+
+
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
+
+
+
-
+
-
-
-
-
+
+
-
+
+
+
+
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
+
+
+
+
+
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
+
+
+
+
+
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
diff --git a/L2J_Mobius_Test/dist/game/data/stats/skills/30000-30099.xml b/L2J_Mobius_Test/dist/game/data/stats/skills/30000-30099.xml
index 26eb8bdd1c..0347de1f22 100644
--- a/L2J_Mobius_Test/dist/game/data/stats/skills/30000-30099.xml
+++ b/L2J_Mobius_Test/dist/game/data/stats/skills/30000-30099.xml
@@ -653,14 +653,16 @@
-
-
+
+
+
-
+
+
diff --git a/L2J_Mobius_Test/dist/game/data/stats/skills/30400-30499.xml b/L2J_Mobius_Test/dist/game/data/stats/skills/30400-30499.xml
index c8b499ab9f..55a57cfd3d 100644
--- a/L2J_Mobius_Test/dist/game/data/stats/skills/30400-30499.xml
+++ b/L2J_Mobius_Test/dist/game/data/stats/skills/30400-30499.xml
@@ -2,11 +2,11 @@
-
-
+
+
-
+
@@ -17,32 +17,33 @@
-
-
-
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
+
diff --git a/L2J_Mobius_Test/dist/game/data/stats/skills/30500-30599.xml b/L2J_Mobius_Test/dist/game/data/stats/skills/30500-30599.xml
index 2ba98d0cbc..9c14b07a27 100644
--- a/L2J_Mobius_Test/dist/game/data/stats/skills/30500-30599.xml
+++ b/L2J_Mobius_Test/dist/game/data/stats/skills/30500-30599.xml
@@ -1072,15 +1072,17 @@
+
+
-
-
+
-
+
+
diff --git a/L2J_Mobius_Test/dist/game/data/stats/transformations/20007.xml b/L2J_Mobius_Test/dist/game/data/stats/transformations/20007.xml
index 32d228acc8..36cfe7599f 100644
--- a/L2J_Mobius_Test/dist/game/data/stats/transformations/20007.xml
+++ b/L2J_Mobius_Test/dist/game/data/stats/transformations/20007.xml
@@ -4,7 +4,7 @@
-
+
0 1 3 4 5 6 7 8 9 11 10 15 16 17 18 19 21 22 23 28 32 36 37 39 40 41 42 43 44 45 46 47 48 50 52 53 54 55 56 57 61 63 64 65 70 1000 1001 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/Config.java b/L2J_Mobius_Test/java/com/l2jmobius/Config.java
index 5b083e0f5a..7132d5ff8b 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/Config.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/Config.java
@@ -65,7 +65,6 @@ import com.l2jmobius.gameserver.model.holders.ItemHolder;
import com.l2jmobius.gameserver.util.FloodProtectorConfig;
import com.l2jmobius.gameserver.util.Util;
import com.l2jmobius.util.PropertiesParser;
-import com.l2jmobius.util.StringUtil;
import com.l2jmobius.util.data.xml.IXmlReader;
/**
@@ -1425,7 +1424,7 @@ public final class Config
final String[] skillSplit = skill.split(",");
if (skillSplit.length != 2)
{
- _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillDurationList \"", skill, "\""));
+ _log.warning("[SkillDurationList]: invalid config property -> SkillDurationList \"" + skill + "\"");
}
else
{
@@ -1437,7 +1436,7 @@ public final class Config
{
if (!skill.isEmpty())
{
- _log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
+ _log.warning("[SkillDurationList]: invalid config property -> SkillList \"" + skillSplit[0] + "\"" + skillSplit[1]);
}
}
}
@@ -1454,7 +1453,7 @@ public final class Config
final String[] skillSplit = skill.split(",");
if (skillSplit.length != 2)
{
- _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillReuseList \"", skill, "\""));
+ _log.warning("[SkillReuseList]: invalid config property -> SkillReuseList \"" + skill + "\"");
}
else
{
@@ -1466,7 +1465,7 @@ public final class Config
{
if (!skill.isEmpty())
{
- _log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
+ _log.warning("[SkillReuseList]: invalid config property -> SkillList \"" + skillSplit[0] + "\"" + skillSplit[1]);
}
}
}
@@ -2064,7 +2063,7 @@ public final class Config
final String[] propSplit = prop.split(",");
if (propSplit.length != 2)
{
- _log.warning(StringUtil.concat("[CustomMinionsRespawnTime]: invalid config property -> CustomMinionsRespawnTime \"", prop, "\""));
+ _log.warning("[CustomMinionsRespawnTime]: invalid config property -> CustomMinionsRespawnTime \"" + prop + "\"");
}
try
@@ -2075,7 +2074,7 @@ public final class Config
{
if (!prop.isEmpty())
{
- _log.warning(StringUtil.concat("[CustomMinionsRespawnTime]: invalid config property -> CustomMinionsRespawnTime \"", propSplit[0], "\"", propSplit[1]));
+ _log.warning("[CustomMinionsRespawnTime]: invalid config property -> CustomMinionsRespawnTime \"" + propSplit[0] + "\"" + propSplit[1]);
}
}
}
@@ -2160,7 +2159,7 @@ public final class Config
final String[] itemSplit = item.split(",");
if (itemSplit.length != 2)
{
- _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
+ _log.warning("Config.load(): invalid config property -> RateDropItemsById \"" + item + "\"");
}
else
{
@@ -2172,7 +2171,7 @@ public final class Config
{
if (!item.isEmpty())
{
- _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
+ _log.warning("Config.load(): invalid config property -> RateDropItemsById \"" + item + "\"");
}
}
}
@@ -2188,7 +2187,7 @@ public final class Config
final String[] itemSplit = item.split(",");
if (itemSplit.length != 2)
{
- _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
+ _log.warning("Config.load(): invalid config property -> RateDropItemsById \"" + item + "\"");
}
else
{
@@ -2200,7 +2199,7 @@ public final class Config
{
if (!item.isEmpty())
{
- _log.warning(StringUtil.concat("Config.load(): invalid config property -> RateDropItemsById \"", item, "\""));
+ _log.warning("Config.load(): invalid config property -> RateDropItemsById \"" + item + "\"");
}
}
}
@@ -2336,7 +2335,7 @@ public final class Config
final String[] rewardSplit = reward.split(",");
if (rewardSplit.length != 2)
{
- _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
+ _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"" + reward + "\"");
}
else
{
@@ -2352,7 +2351,7 @@ public final class Config
{
if (!reward.isEmpty())
{
- _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
+ _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"" + reward + "\"");
}
}
}
@@ -2374,7 +2373,7 @@ public final class Config
{
if (!door.isEmpty())
{
- _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToOpen \"", door, "\""));
+ _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToOpen \"" + door + "\"");
}
}
}
@@ -2390,7 +2389,7 @@ public final class Config
{
if (!door.isEmpty())
{
- _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToClose \"", door, "\""));
+ _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToClose \"" + door + "\"");
}
}
}
@@ -2404,7 +2403,7 @@ public final class Config
final String[] skillSplit = skill.split(",");
if (skillSplit.length != 2)
{
- _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
+ _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"" + skill + "\"");
}
else
{
@@ -2416,7 +2415,7 @@ public final class Config
{
if (!skill.isEmpty())
{
- _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"", skill, "\""));
+ _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventFighterBuffs \"" + skill + "\"");
}
}
}
@@ -2432,7 +2431,7 @@ public final class Config
final String[] skillSplit = skill.split(",");
if (skillSplit.length != 2)
{
- _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
+ _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"" + skill + "\"");
}
else
{
@@ -2444,7 +2443,7 @@ public final class Config
{
if (!skill.isEmpty())
{
- _log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"", skill, "\""));
+ _log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventMageBuffs \"" + skill + "\"");
}
}
}
@@ -2533,7 +2532,7 @@ public final class Config
final String[] entrySplit = entry.split(",");
if (entrySplit.length != 2)
{
- _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid config property -> DualboxCheckWhitelist \"", entry, "\""));
+ _log.warning("DualboxCheck[Config.load()]: invalid config property -> DualboxCheckWhitelist \"" + entry + "\"");
}
else
{
@@ -2545,11 +2544,11 @@ public final class Config
}
catch (UnknownHostException e)
{
- _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid address -> DualboxCheckWhitelist \"", entrySplit[0], "\""));
+ _log.warning("DualboxCheck[Config.load()]: invalid address -> DualboxCheckWhitelist \"" + entrySplit[0] + "\"");
}
catch (NumberFormatException e)
{
- _log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid number -> DualboxCheckWhitelist \"", entrySplit[1], "\""));
+ _log.warning("DualboxCheck[Config.load()]: invalid number -> DualboxCheckWhitelist \"" + entrySplit[1] + "\"");
}
}
}
@@ -2634,7 +2633,7 @@ public final class Config
String[] itemSplit = item.split(",");
if (itemSplit.length != 2)
{
- _log.warning(StringUtil.concat("Config.load(): invalid config property -> PremiumRateDropChanceByItemId \"", item, "\""));
+ _log.warning("Config.load(): invalid config property -> PremiumRateDropChanceByItemId \"" + item + "\"");
}
else
{
@@ -2646,7 +2645,7 @@ public final class Config
{
if (!item.isEmpty())
{
- _log.warning(StringUtil.concat("Config.load(): invalid config property -> PremiumRateDropChanceByItemId \"", item, "\""));
+ _log.warning("Config.load(): invalid config property -> PremiumRateDropChanceByItemId \"" + item + "\"");
}
}
}
@@ -2661,7 +2660,7 @@ public final class Config
String[] itemSplit = item.split(",");
if (itemSplit.length != 2)
{
- _log.warning(StringUtil.concat("Config.load(): invalid config property -> PremiumRateDropAmountByItemId \"", item, "\""));
+ _log.warning("Config.load(): invalid config property -> PremiumRateDropAmountByItemId \"" + item + "\"");
}
else
{
@@ -2673,7 +2672,7 @@ public final class Config
{
if (!item.isEmpty())
{
- _log.warning(StringUtil.concat("Config.load(): invalid config property -> PremiumRateDropAmountByItemId \"", item, "\""));
+ _log.warning("Config.load(): invalid config property -> PremiumRateDropAmountByItemId \"" + item + "\"");
}
}
}
@@ -3008,7 +3007,7 @@ public final class Config
}
catch (Exception e)
{
- _log.warning(StringUtil.concat("Failed to save hex id to ", fileName, " File."));
+ _log.warning("Failed to save hex id to " + fileName + " File.");
_log.warning("Config: " + e.getMessage());
}
}
@@ -3046,11 +3045,11 @@ public final class Config
*/
private static void loadFloodProtectorConfig(PropertiesParser properties, FloodProtectorConfig config, String configString, int defaultInterval)
{
- config.FLOOD_PROTECTION_INTERVAL = properties.getInt(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval);
- config.LOG_FLOODING = properties.getBoolean(StringUtil.concat("FloodProtector", configString, "LogFlooding"), false);
- config.PUNISHMENT_LIMIT = properties.getInt(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), 0);
- config.PUNISHMENT_TYPE = properties.getString(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
- config.PUNISHMENT_TIME = properties.getInt(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), 0) * 60000;
+ config.FLOOD_PROTECTION_INTERVAL = properties.getInt("FloodProtector" + configString + "Interval", defaultInterval);
+ config.LOG_FLOODING = properties.getBoolean("FloodProtector" + configString + "LogFlooding", false);
+ config.PUNISHMENT_LIMIT = properties.getInt("FloodProtector" + configString + "PunishmentLimit", 0);
+ config.PUNISHMENT_TYPE = properties.getString("FloodProtector" + configString + "PunishmentType", "none");
+ config.PUNISHMENT_TIME = properties.getInt("FloodProtector" + configString + "PunishmentTime", 0) * 60000;
}
public static int getServerTypeId(String[] serverTypes)
@@ -3234,7 +3233,7 @@ public final class Config
valueSplit = value.split(",");
if (valueSplit.length != 2)
{
- _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid entry -> \"", valueSplit[0], "\", should be itemId,itemNumber. Skipping to the next entry in the list."));
+ _log.warning("parseItemsList[Config.load()]: invalid entry -> \"" + valueSplit[0] + "\", should be itemId,itemNumber. Skipping to the next entry in the list.");
continue;
}
@@ -3245,7 +3244,7 @@ public final class Config
}
catch (NumberFormatException e)
{
- _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid itemId -> \"", valueSplit[0], "\", value must be an integer. Skipping to the next entry in the list."));
+ _log.warning("parseItemsList[Config.load()]: invalid itemId -> \"" + valueSplit[0] + "\", value must be an integer. Skipping to the next entry in the list.");
continue;
}
try
@@ -3254,7 +3253,7 @@ public final class Config
}
catch (NumberFormatException e)
{
- _log.warning(StringUtil.concat("parseItemsList[Config.load()]: invalid item number -> \"", valueSplit[1], "\", value must be an integer. Skipping to the next entry in the list."));
+ _log.warning("parseItemsList[Config.load()]: invalid item number -> \"" + valueSplit[1] + "\", value must be an integer. Skipping to the next entry in the list.");
continue;
}
result[i++] = tmp;
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/ThreadPoolManager.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/ThreadPoolManager.java
index f0f6f4e260..32774eee2a 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/ThreadPoolManager.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/ThreadPoolManager.java
@@ -30,7 +30,6 @@ import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.model.StatsSet;
-import com.l2jmobius.util.StringUtil;
/**
*
@@ -694,7 +693,7 @@ public class ThreadPoolManager
final int count = ptf.getGroup().activeCount();
final Thread[] threads = new Thread[count + 2];
ptf.getGroup().enumerate(threads);
- StringUtil.append(sb, "General Packet Thread Pool:" + Config.EOL + "Tasks in the queue: ", String.valueOf(_generalPacketsThreadPool.getQueue().size()), Config.EOL + "Showing threads stack trace:" + Config.EOL + "There should be ", String.valueOf(count), " Threads" + Config.EOL);
+ sb.append("General Packet Thread Pool:" + Config.EOL + "Tasks in the queue: " + _generalPacketsThreadPool.getQueue().size() + Config.EOL + "Showing threads stack trace:" + Config.EOL + "There should be " + count + " Threads" + Config.EOL);
for (Thread t : threads)
{
if (t == null)
@@ -702,10 +701,12 @@ public class ThreadPoolManager
continue;
}
- StringUtil.append(sb, t.getName(), Config.EOL);
+ sb.append(t.getName());
+ sb.append(Config.EOL);
for (StackTraceElement ste : t.getStackTrace())
{
- StringUtil.append(sb, ste.toString(), Config.EOL);
+ sb.append(ste);
+ sb.append(Config.EOL);
}
}
}
@@ -726,7 +727,7 @@ public class ThreadPoolManager
final int count = ptf.getGroup().activeCount();
final Thread[] threads = new Thread[count + 2];
ptf.getGroup().enumerate(threads);
- StringUtil.append(sb, "I/O Packet Thread Pool:" + Config.EOL + "Tasks in the queue: ", String.valueOf(_ioPacketsThreadPool.getQueue().size()), Config.EOL + "Showing threads stack trace:" + Config.EOL + "There should be ", String.valueOf(count), " Threads" + Config.EOL);
+ sb.append("I/O Packet Thread Pool:" + Config.EOL + "Tasks in the queue: " + _ioPacketsThreadPool.getQueue().size() + Config.EOL + "Showing threads stack trace:" + Config.EOL + "There should be " + count + " Threads" + Config.EOL);
for (Thread t : threads)
{
@@ -735,11 +736,12 @@ public class ThreadPoolManager
continue;
}
- StringUtil.append(sb, t.getName(), Config.EOL);
-
+ sb.append(t.getName());
+ sb.append(Config.EOL);
for (StackTraceElement ste : t.getStackTrace())
{
- StringUtil.append(sb, ste.toString(), Config.EOL);
+ sb.append(ste);
+ sb.append(Config.EOL);
}
}
}
@@ -760,7 +762,7 @@ public class ThreadPoolManager
final int count = ptf.getGroup().activeCount();
final Thread[] threads = new Thread[count + 2];
ptf.getGroup().enumerate(threads);
- StringUtil.append(sb, "General Thread Pool:" + Config.EOL + "Tasks in the queue: ", String.valueOf(_generalThreadPool.getQueue().size()), Config.EOL + "Showing threads stack trace:" + Config.EOL + "There should be ", String.valueOf(count), " Threads" + Config.EOL);
+ sb.append("General Thread Pool:" + Config.EOL + "Tasks in the queue: " + _generalThreadPool.getQueue().size() + Config.EOL + "Showing threads stack trace:" + Config.EOL + "There should be " + +count + " Threads" + Config.EOL);
for (Thread t : threads)
{
@@ -769,11 +771,12 @@ public class ThreadPoolManager
continue;
}
- StringUtil.append(sb, t.getName(), Config.EOL);
-
+ sb.append(t.getName());
+ sb.append(Config.EOL);
for (StackTraceElement ste : t.getStackTrace())
{
- StringUtil.append(sb, ste.toString(), Config.EOL);
+ sb.append(ste);
+ sb.append(Config.EOL);
}
}
}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/communitybbs/Manager/PostBBSManager.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/communitybbs/Manager/PostBBSManager.java
index c5114568d1..c483740b34 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/communitybbs/Manager/PostBBSManager.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/communitybbs/Manager/PostBBSManager.java
@@ -28,7 +28,6 @@ import com.l2jmobius.gameserver.communitybbs.BB.Post;
import com.l2jmobius.gameserver.communitybbs.BB.Topic;
import com.l2jmobius.gameserver.handler.CommunityBoardHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jmobius.util.StringUtil;
public class PostBBSManager extends BaseBBSManager
{
@@ -126,15 +125,23 @@ public class PostBBSManager extends BaseBBSManager
private void showHtmlEditPost(Topic topic, L2PcInstance activeChar, Forum forum, Post p)
{
- final String html = StringUtil.concat("
&$413; ", topic.getName(), "
");
+ final String html = "&$413; " + topic.getName() + "
";
send1001(html, activeChar);
send1002(activeChar, p.getCPost(0).postTxt, topic.getName(), DateFormat.getInstance().format(new Date(topic.getDate())));
}
private void showMemoPost(Topic topic, L2PcInstance activeChar, Forum forum)
{
- final Post p = getGPosttByTopic(topic);
- CommunityBoardHandler.separateAndSend(StringUtil.concat("&$413; : ", topic.getName(), " &$417; : ", topic.getOwnerName() + " &$418; : ", DateFormat.getDateInstance(DateFormat.FULL, Locale.getDefault()).format(p.getCPost(0).postDate), "
", p.getCPost(0).postTxt.replace(">", ">").replace("<", "<"), "
"), activeChar);
+ //
+ Post p = getGPosttByTopic(topic);
+ Locale locale = Locale.getDefault();
+ DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, locale);
+
+ String mes = p.getCPost(0).postTxt.replace(">", ">");
+ mes = mes.replace("<", "<");
+
+ final String html = "&$413; : " + topic.getName() + " &$417; : " + topic.getOwnerName() + " &$418; : " + dateFormat.format(p.getCPost(0).postDate) + "
";
+ CommunityBoardHandler.separateAndSend(html, activeChar);
}
@Override
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/communitybbs/Manager/TopicBBSManager.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/communitybbs/Manager/TopicBBSManager.java
index 2c89d2d9f5..d758d27c41 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/communitybbs/Manager/TopicBBSManager.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/communitybbs/Manager/TopicBBSManager.java
@@ -31,7 +31,6 @@ import com.l2jmobius.gameserver.communitybbs.BB.Topic;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.handler.CommunityBoardHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jmobius.util.StringUtil;
public class TopicBBSManager extends BaseBBSManager
{
@@ -211,7 +210,7 @@ public class TopicBBSManager extends BaseBBSManager
private void showMemoNewTopics(Forum forum, L2PcInstance activeChar)
{
- final String html = StringUtil.concat(" ");
+ final String html = " ";
send1001(html, activeChar);
send1002(activeChar);
}
@@ -235,7 +234,8 @@ public class TopicBBSManager extends BaseBBSManager
private void showMemoTopics(Forum forum, L2PcInstance activeChar, int index)
{
forum.vload();
- final StringBuilder html = StringUtil.startAppend(2000, "");
+ final StringBuilder html = new StringBuilder(2000);
+ html.append("");
final DateFormat dateFormat = DateFormat.getInstance();
for (int i = 0, j = getMaxID(forum) + 1; i < (12 * index); j--)
@@ -244,10 +244,13 @@ public class TopicBBSManager extends BaseBBSManager
{
break;
}
- final Topic t = forum.getTopic(j);
- if ((t != null) && (i++ >= (12 * (index - 1))))
+ Topic t = forum.getTopic(j);
+ if (t != null)
{
- StringUtil.append(html, " ");
+ if (i++ >= (12 * (index - 1)))
+ {
+ html.append(" ");
+ }
}
}
@@ -259,7 +262,7 @@ public class TopicBBSManager extends BaseBBSManager
}
else
{
- StringUtil.append(html, " ");
+ html.append(" ");
}
int nbp = forum.getTopicSize() / 8;
@@ -271,11 +274,11 @@ public class TopicBBSManager extends BaseBBSManager
{
if (i == index)
{
- StringUtil.append(html, " ", String.valueOf(i), " ");
+ html.append(" " + i + " ");
}
else
{
- StringUtil.append(html, " ", String.valueOf(i), " ");
+ html.append(" " + i + " ");
}
}
if (index == nbp)
@@ -284,10 +287,10 @@ public class TopicBBSManager extends BaseBBSManager
}
else
{
- StringUtil.append(html, " ");
+ html.append(" ");
}
- StringUtil.append(html, "
");
+ html.append("
");
CommunityBoardHandler.separateAndSend(html.toString(), activeChar);
}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java
index 2bb160c556..4504ee67f2 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java
@@ -96,7 +96,7 @@ public class NpcData implements IXmlReader
if ("npc".equalsIgnoreCase(listNode.getNodeName()))
{
NamedNodeMap attrs = listNode.getAttributes();
- final StatsSet set = new StatsSet();
+ final StatsSet set = new StatsSet(new HashMap<>());
final int npcId = parseInteger(attrs, "id");
Map parameters = null;
Map skills = null;
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
index 24b17b827a..6a205f1008 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/instancemanager/GrandBossManager.java
@@ -88,13 +88,9 @@ public final class GrandBossManager implements IStorable
info.set("loc_z", rs.getInt("loc_z"));
info.set("heading", rs.getInt("heading"));
info.set("respawn_time", rs.getLong("respawn_time"));
- final double HP = rs.getDouble("currentHP"); // jython doesn't recognize doubles
- final int true_HP = (int) HP; // so use java's ability to type cast
- info.set("currentHP", true_HP); // to convert double to int
- final double MP = rs.getDouble("currentMP");
- final int true_MP = (int) MP;
- info.set("currentMP", true_MP);
- final int status = rs.getInt("status");
+ info.set("currentHP", rs.getDouble("currentHP"));
+ info.set("currentMP", rs.getDouble("currentMP"));
+ int status = rs.getInt("status");
_bossStatus.put(bossId, status);
_storedInfo.put(bossId, info);
_log.info(getClass().getSimpleName() + ": " + NpcData.getInstance().getTemplate(bossId).getName() + "(" + bossId + ") status is " + status + ".");
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/instancemanager/PetitionManager.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/instancemanager/PetitionManager.java
index 9a889f0c27..1f6f5d3467 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/instancemanager/PetitionManager.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/instancemanager/PetitionManager.java
@@ -32,7 +32,6 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
-import com.l2jmobius.util.StringUtil;
/**
* Petition Manager
@@ -352,7 +351,8 @@ public final class PetitionManager
public void sendPendingPetitionList(L2PcInstance activeChar)
{
- final StringBuilder htmlContent = StringUtil.startAppend(600 + (getPendingPetitionCount() * 300), " ");
+ final StringBuilder htmlContent = new StringBuilder(600 + (getPendingPetitionCount() * 300));
+ htmlContent.append(" ");
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
@@ -374,18 +374,18 @@ public final class PetitionManager
continue;
}
- StringUtil.append(htmlContent, "", dateFormat.format(new Date(currPetition.getSubmitTime())));
- StringUtil.append(htmlContent, " ", currPetition.getPetitioner().getName(), " ");
- StringUtil.append(htmlContent, "");
+ htmlContent.append(" " + dateFormat.format(new Date(currPetition.getSubmitTime())));
+ htmlContent.append(" " + currPetition.getPetitioner().getName() + " ");
+ htmlContent.append("");
if (currPetition.getState() != PetitionState.IN_PROCESS)
{
- StringUtil.append(htmlContent, "");
+ htmlContent.append("");
}
else
{
htmlContent.append("" + currPetition.getResponder().getName() + " ");
}
- StringUtil.append(htmlContent, " ", currPetition.getTypeAsString(), "", currPetition.getTypeAsString(), "
");
+ htmlContent.append("" + currPetition.getTypeAsString() + "" + currPetition.getTypeAsString() + "
");
color = !color;
petcount++;
if (petcount > 10)
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/MacroList.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/MacroList.java
index 4972660fdd..a24fd2a202 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/MacroList.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/MacroList.java
@@ -36,7 +36,6 @@ import com.l2jmobius.gameserver.enums.ShortcutType;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.interfaces.IRestorable;
import com.l2jmobius.gameserver.network.serverpackets.SendMacroList;
-import com.l2jmobius.util.StringUtil;
public class MacroList implements IRestorable
{
@@ -136,10 +135,10 @@ public class MacroList implements IRestorable
final StringBuilder sb = new StringBuilder(300);
for (MacroCmd cmd : macro.getCommands())
{
- StringUtil.append(sb, String.valueOf(cmd.getType().ordinal()), ",", String.valueOf(cmd.getD1()), ",", String.valueOf(cmd.getD2()));
+ sb.append(cmd.getType().ordinal() + "," + cmd.getD1() + "," + cmd.getD2());
if ((cmd.getCmd() != null) && (cmd.getCmd().length() > 0))
{
- StringUtil.append(sb, ",", cmd.getCmd());
+ sb.append("," + cmd.getCmd());
}
sb.append(';');
}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2ClassMasterInstance.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2ClassMasterInstance.java
index 72b0676766..e6cdee324d 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2ClassMasterInstance.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2ClassMasterInstance.java
@@ -34,7 +34,6 @@ import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.TutorialCloseHtml;
import com.l2jmobius.gameserver.network.serverpackets.TutorialShowQuestionMark;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
-import com.l2jmobius.util.StringUtil;
/**
* This class ...
@@ -295,7 +294,7 @@ public final class L2ClassMasterInstance extends L2MerchantInstance
}
if (validateClassId(currentClassId, cid) && (cid.level() == level))
{
- StringUtil.append(menu, "", ClassListData.getInstance().getClass(cid).getClientCode(), " ");
+ menu.append("" + ClassListData.getInstance().getClass(cid).getClientCode() + " ");
}
}
@@ -346,7 +345,7 @@ public final class L2ClassMasterInstance extends L2MerchantInstance
}
if (validateClassId(currentClassId, cid))
{
- StringUtil.append(menu, "", ClassListData.getInstance().getClass(cid).getEscapedClientCode(), " ");
+ menu.append("" + ClassListData.getInstance().getClass(cid).getEscapedClientCode() + " ");
}
}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java
index 64d2d3ab65..1a77edaf89 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java
@@ -32,7 +32,6 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
-import com.l2jmobius.util.StringUtil;
public class L2NpcInstance extends L2Npc
{
@@ -112,7 +111,7 @@ public class L2NpcInstance extends L2Npc
if (((L2NpcInstance) npc).getClassesToTeach().isEmpty())
{
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
- final String sb = StringUtil.concat("I cannot teach you. My class list is empty. Ask admin to fix it. Need add my npcid and classes to skill_learn.sql. NpcId:", String.valueOf(npcId), ", Your classId:", String.valueOf(player.getClassId().getId()), "");
+ final String sb = "I cannot teach you. My class list is empty. Ask admin to fix it. Need add my npcid and classes to skill_learn.sql. NpcId:" + npcId + ", Your classId:" + player.getClassId().getId() + "";
html.setHtml(sb);
player.sendPacket(html);
return;
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
index 6067eef248..7e6de10138 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java
@@ -287,6 +287,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
import com.l2jmobius.gameserver.network.serverpackets.ExUseSharedGroupItem;
import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoAbnormalVisualEffect;
import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
+import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoFishing;
import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
import com.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
import com.l2jmobius.gameserver.network.serverpackets.GameGuardQuery;
@@ -303,6 +304,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ObservationMode;
import com.l2jmobius.gameserver.network.serverpackets.ObservationReturn;
import com.l2jmobius.gameserver.network.serverpackets.PartySmallWindowUpdate;
import com.l2jmobius.gameserver.network.serverpackets.PetInventoryUpdate;
+import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import com.l2jmobius.gameserver.network.serverpackets.PledgeShowMemberListDelete;
import com.l2jmobius.gameserver.network.serverpackets.PledgeShowMemberListUpdate;
import com.l2jmobius.gameserver.network.serverpackets.PrivateStoreListBuy;
@@ -11832,7 +11834,7 @@ public final class L2PcInstance extends L2Playable
_fishx = _x;
_fishy = _y;
_fishz = _z;
- // broadcastUserInfo();
+
// Starts fishing
final int lvl = getRandomFishLvl();
final int grade = getRandomFishGrade();
@@ -11852,9 +11854,9 @@ public final class L2PcInstance extends L2Playable
{
_fish.setFishGroup(-1);
}
- // sendMessage("Hook x,y: " + _x + "," + _y + " - Water Z, Player Z:" + _z + ", " + getZ()); // debug line, uncoment to show coordinates used in fishing.
broadcastPacket(new ExFishingStart(this, _fish.getFishGroup(), _x, _y, _z, _lure.isNightLure()));
- // sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
+ sendPacket(new ExUserInfoFishing(this));
+ sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
startLookingForFishTask();
}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/Hero.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/Hero.java
index e26bbc2934..9e1a081137 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/Hero.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/Hero.java
@@ -54,7 +54,6 @@ import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
-import com.l2jmobius.util.StringUtil;
/**
* Hero entity.
@@ -464,19 +463,19 @@ public class Hero
{
breakat = i;
final StatsSet diaryEntry = list.get(i);
- StringUtil.append(fList, "");
+ fList.append(" ");
if (color)
{
- StringUtil.append(fList, "");
+ fList.append("");
}
else
{
- StringUtil.append(fList, "");
+ fList.append("");
}
- StringUtil.append(fList, "" + diaryEntry.getString("date") + ":xx ");
- StringUtil.append(fList, "" + diaryEntry.getString("action") + " ");
- StringUtil.append(fList, "
");
- StringUtil.append(fList, "");
+ fList.append("" + diaryEntry.getString("date") + ":xx ");
+ fList.append("" + diaryEntry.getString("action") + " ");
+ fList.append("
");
+ fList.append("");
color = !color;
counter++;
if (counter >= perpage)
@@ -552,19 +551,19 @@ public class Hero
{
breakat = i;
final StatsSet fight = heroFights.get(i);
- StringUtil.append(fList, "");
+ fList.append(" ");
if (color)
{
- StringUtil.append(fList, "");
+ fList.append("");
}
else
{
- StringUtil.append(fList, "");
+ fList.append("");
}
- StringUtil.append(fList, "" + fight.getString("start") + " " + fight.getString("result") + "" + (fight.getInt("classed") > 0 ? "cls " : "non-cls") + " ");
- StringUtil.append(fList, "vs " + fight.getString("oponent") + " (" + fight.getString("oponentclass") + ") (" + fight.getString("time") + ") ");
- StringUtil.append(fList, "
");
- StringUtil.append(fList, "");
+ fList.append("" + fight.getString("start") + " " + fight.getString("result") + "" + (fight.getInt("classed") > 0 ? "cls " : "non-cls") + " ");
+ fList.append("vs " + fight.getString("oponent") + " (" + fight.getString("oponentclass") + ") (" + fight.getString("time") + ") ");
+ fList.append("
");
+ fList.append("");
color = !color;
counter++;
if (counter >= perpage)
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/Message.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/Message.java
index 76d9cbb28b..07f49aec10 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/Message.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/Message.java
@@ -52,7 +52,7 @@ public class Message
private String _receiverName = null;
private final String _subject, _content;
private boolean _unread, _returned;
- private MailType _messageType = MailType.REGULAR;
+ private final MailType _messageType;
private boolean _deletedBySender;
private boolean _deletedByReceiver;
private final long _reqAdena;
@@ -112,6 +112,7 @@ public class Message
_deletedBySender = false;
_deletedByReceiver = false;
_reqAdena = reqAdena;
+ _messageType = MailType.REGULAR;
}
/*
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/TvTEvent.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/TvTEvent.java
index 7d9b423ed7..cef69acf75 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/TvTEvent.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/entity/TvTEvent.java
@@ -55,7 +55,6 @@ import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.util.Rnd;
-import com.l2jmobius.util.StringUtil;
/**
* @author HorridoJoho
@@ -540,7 +539,7 @@ public class TvTEvent
return "-";
}
- return StringUtil.concat(String.valueOf(itemNum), " ", ItemTable.getInstance().getTemplate(itemId).getName());
+ return itemNum + " " + ItemTable.getInstance().getTemplate(itemId).getName();
}
/**
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
index 79b2a4be1d..f8074c0773 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/itemcontainer/Inventory.java
@@ -43,7 +43,7 @@ import com.l2jmobius.gameserver.model.items.type.WeaponType;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
-import com.l2jmobius.util.StringUtil;
+import com.l2jmobius.util.Util;
/**
* This class manages inventory
@@ -1678,7 +1678,7 @@ public abstract class Inventory extends ItemContainer
default:
{
_log.info("Unhandled slot type: " + slot);
- _log.info(StringUtil.getTraceString(Thread.currentThread().getStackTrace()));
+ _log.info(Util.getTraceString(Thread.currentThread().getStackTrace()));
}
}
if (pdollSlot < 0)
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Armor.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Armor.java
index 66eeee3b10..7f5f0899f0 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Armor.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Armor.java
@@ -20,7 +20,6 @@ import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.items.type.ArmorType;
import com.l2jmobius.gameserver.model.skills.Skill;
-import com.l2jmobius.util.StringUtil;
/**
* This class is dedicated to the management of armors.
@@ -86,7 +85,7 @@ public final class L2Armor extends L2Item
catch (Exception nfe)
{
// Incorrect syntax, don't add new skill
- _log.info(StringUtil.concat("> Couldnt parse ", skill, " in armor enchant skills! item ", toString()));
+ _log.info("> Couldnt parse " + skill + " in armor enchant skills! item " + this);
}
if ((id > 0) && (level > 0))
{
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2EtcItem.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2EtcItem.java
index 574c955b88..d8bfa5e696 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2EtcItem.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2EtcItem.java
@@ -23,7 +23,6 @@ import com.l2jmobius.gameserver.model.L2ExtractableProduct;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
import com.l2jmobius.gameserver.model.items.type.EtcItemType;
-import com.l2jmobius.util.StringUtil;
/**
* This class is dedicated to the management of EtcItem.
@@ -96,7 +95,7 @@ public final class L2EtcItem extends L2Item
final String[] data = part.split(",");
if ((data.length != 4) && (data.length != 6))
{
- _log.info(StringUtil.concat("> Couldnt parse ", part, " in capsuled_items! item ", toString()));
+ _log.info("> Couldnt parse " + part + " in capsuled_items! item " + this);
continue;
}
final int itemId = Integer.parseInt(data[0]);
@@ -104,7 +103,7 @@ public final class L2EtcItem extends L2Item
final int max = Integer.parseInt(data[2]);
if (max < min)
{
- _log.info(StringUtil.concat("> Max amount < Min amount in ", part, ", item ", toString()));
+ _log.info("> Max amount < Min amount in " + part + ", item " + this);
continue;
}
final double chance = Double.parseDouble(data[3]);
@@ -116,7 +115,7 @@ public final class L2EtcItem extends L2Item
maxEnchant = Integer.parseInt(data[5]);
if (maxEnchant < minEnchant)
{
- _log.info(StringUtil.concat("> Max enchant < Min enchant in ", part, ", item ", toString()));
+ _log.info("> Max enchant < Min enchant in " + part + ", item " + this);
continue;
}
}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Item.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Item.java
index 88510e673c..e90bb3d057 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Item.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Item.java
@@ -48,7 +48,6 @@ import com.l2jmobius.gameserver.model.stats.functions.AbstractFunction;
import com.l2jmobius.gameserver.model.stats.functions.FuncTemplate;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
-import com.l2jmobius.util.StringUtil;
/**
* This class contains all informations concerning the item (weapon, armor, etc).
@@ -66,7 +65,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
public static final int TYPE1_WEAPON_RING_EARRING_NECKLACE = 0;
public static final int TYPE1_SHIELD_ARMOR = 1;
public static final int TYPE1_ITEM_QUESTITEM_ADENA = 4;
-
+
public static final int TYPE2_WEAPON = 0;
public static final int TYPE2_SHIELD_ARMOR = 1;
public static final int TYPE2_ACCESSORY = 2;
@@ -112,43 +111,43 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
public static final int SLOT_MULTI_ALLWEAPON = SLOT_LR_HAND | SLOT_R_HAND;
- private int _itemId;
- private int _displayId;
- private String _name;
- private String _additionalName;
- private String _icon;
- private int _weight;
- private boolean _stackable;
- private MaterialType _materialType;
- private CrystalType _crystalType;
- private int _equipReuseDelay;
- private int _duration;
- private int _time;
- private int _autoDestroyTime;
- private int _bodyPart;
- private int _referencePrice;
- private int _crystalCount;
- private boolean _sellable;
- private boolean _dropable;
- private boolean _destroyable;
- private boolean _tradeable;
- private boolean _depositable;
- private boolean _auctionable;
- private int _enchantable;
- private boolean _elementable;
- private boolean _questItem;
- private boolean _freightable;
- private boolean _allow_self_resurrection;
- private boolean _is_oly_restricted;
- private boolean _for_npc;
- private boolean _common;
- private boolean _heroItem;
- private boolean _pvpItem;
- private boolean _immediate_effect;
- private boolean _ex_immediate_effect;
- private int _defaultEnchantLevel;
- private ActionType _defaultAction;
- private boolean _isBlessedItem;
+ private int _itemId;
+ private int _displayId;
+ private String _name;
+ private String _additionalName;
+ private String _icon;
+ private int _weight;
+ private boolean _stackable;
+ private MaterialType _materialType;
+ private CrystalType _crystalType;
+ private int _equipReuseDelay;
+ private int _duration;
+ private int _time;
+ private int _autoDestroyTime;
+ private int _bodyPart;
+ private int _referencePrice;
+ private int _crystalCount;
+ private boolean _sellable;
+ private boolean _dropable;
+ private boolean _destroyable;
+ private boolean _tradeable;
+ private boolean _depositable;
+ private boolean _auctionable;
+ private int _enchantable;
+ private boolean _elementable;
+ private boolean _questItem;
+ private boolean _freightable;
+ private boolean _allow_self_resurrection;
+ private boolean _is_oly_restricted;
+ private boolean _for_npc;
+ private boolean _common;
+ private boolean _heroItem;
+ private boolean _pvpItem;
+ private boolean _immediate_effect;
+ private boolean _ex_immediate_effect;
+ private int _defaultEnchantLevel;
+ private ActionType _defaultAction;
+ private boolean _isBlessedItem;
protected int _type1; // needed for item list (inventory)
protected int _type2; // different lists for armor, weapon, etc
@@ -159,13 +158,13 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
private SkillHolder _unequipSkill = null;
private SkillHolder _equipSkill = null;
- private int _useSkillDisTime;
- private int _reuseDelay;
- private int _sharedReuseGroup;
+ private int _useSkillDisTime;
+ private int _reuseDelay;
+ private int _sharedReuseGroup;
- private CommissionItemType _commissionItemType;
- private int _compoundItem;
- private float _compoundChance;
+ private CommissionItemType _commissionItemType;
+ private int _compoundItem;
+ private float _compoundChance;
/**
* Constructor of the L2Item that fill class variables.
@@ -240,13 +239,13 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
if (id == 0)
{
- _log.info(StringUtil.concat("Ignoring item_skill(", element, ") for item ", toString(), ". Skill id is 0!"));
+ _log.info("Ignoring item_skill(" + element + ") for item " + this + ". Skill id is 0!");
continue;
}
if (level == 0)
{
- _log.info(StringUtil.concat("Ignoring item_skill(", element, ") for item ", toString(), ". Skill level is 0!"));
+ _log.info("Ignoring item_skill(" + element + ") for item " + this + ". Skill level is 0!");
continue;
}
@@ -255,7 +254,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
}
catch (Exception e)
{
- _log.warning(StringUtil.concat("Failed to parse item_skill(", element, ") for item ", toString(), "! Format: SkillId0-SkillLevel0[;SkillIdN-SkillLevelN]"));
+ _log.warning("Failed to parse item_skill(" + element + ") for item " + this + "! Format: SkillId0-SkillLevel0[;SkillIdN-SkillLevelN]");
}
}
@@ -284,7 +283,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
catch (Exception nfe)
{
// Incorrect syntax, don't add new skill
- _log.info(StringUtil.concat("Couldnt parse ", skills, " in weapon unequip skills! item ", toString()));
+ _log.info("Couldnt parse " + skills + " in weapon unequip skills! item " + this);
}
if ((id > 0) && (level > 0))
{
@@ -309,7 +308,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
catch (Exception nfe)
{
// Incorrect syntax, don't add new skill
- _log.info(StringUtil.concat("Couldnt parse ", skills, " in item equip skill! item ", toString()));
+ _log.info("Couldnt parse " + skills + " in item equip skill! item " + this);
}
if ((id > 0) && (level > 0))
{
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Weapon.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Weapon.java
index 3a78917498..831398bc18 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Weapon.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/items/L2Weapon.java
@@ -33,26 +33,25 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.Util;
-import com.l2jmobius.util.StringUtil;
/**
* This class is dedicated to the management of weapons.
*/
public final class L2Weapon extends L2Item
{
- private WeaponType _type;
- private boolean _isMagicWeapon;
- private int _rndDam;
- private int _soulShotCount;
- private int _spiritShotCount;
- private int _mpConsume;
- private int _baseAttackRange;
- private int _baseAttackAngle;
+ private WeaponType _type;
+ private boolean _isMagicWeapon;
+ private int _rndDam;
+ private int _soulShotCount;
+ private int _spiritShotCount;
+ private int _mpConsume;
+ private int _baseAttackRange;
+ private int _baseAttackAngle;
/**
* Skill that activates when item is enchanted +4 (for duals).
*/
private SkillHolder _enchant4Skill = null;
- private int _changeWeaponId;
+ private int _changeWeaponId;
// Attached skills for Special Abilities
private SkillHolder _skillsOnMagic;
@@ -60,15 +59,15 @@ public final class L2Weapon extends L2Item
private SkillHolder _skillsOnCrit;
private Condition _skillsOnCritCondition = null;
- private int _reducedSoulshot;
- private int _reducedSoulshotChance;
+ private int _reducedSoulshot;
+ private int _reducedSoulshotChance;
- private int _reducedMpConsume;
- private int _reducedMpConsumeChance;
+ private int _reducedMpConsume;
+ private int _reducedMpConsumeChance;
- private boolean _isForceEquip;
- private boolean _isAttackWeapon;
- private boolean _useWeaponSkillsOnly;
+ private boolean _isForceEquip;
+ private boolean _isAttackWeapon;
+ private boolean _useWeaponSkillsOnly;
/**
* Constructor for Weapon.
@@ -120,7 +119,7 @@ public final class L2Weapon extends L2Item
catch (Exception nfe)
{
// Incorrect syntax, dont add new skill
- _log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon enchant skills! item ", toString()));
+ _log.info("> Couldnt parse " + skill + " in weapon enchant skills! item " + this);
}
if ((id > 0) && (level > 0))
{
@@ -146,7 +145,7 @@ public final class L2Weapon extends L2Item
catch (Exception nfe)
{
// Incorrect syntax, don't add new skill
- _log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon onmagic skills! item ", toString()));
+ _log.info("> Couldnt parse " + skill + " in weapon onmagic skills! item " + this);
}
if ((id > 0) && (level > 0) && (chance > 0))
{
@@ -173,7 +172,7 @@ public final class L2Weapon extends L2Item
catch (Exception nfe)
{
// Incorrect syntax, don't add new skill
- _log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon oncrit skills! item ", toString()));
+ _log.info("> Couldnt parse " + skill + " in weapon oncrit skills! item " + this);
}
if ((id > 0) && (level > 0) && (chance > 0))
{
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/quest/QuestState.java
index ae1deae0b9..d5d6384b59 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/quest/QuestState.java
@@ -533,7 +533,11 @@ public final class QuestState
*/
public int getCond()
{
- return isStarted() ? getInt("cond") : 0;
+ if (isStarted())
+ {
+ return getInt("cond");
+ }
+ return 0;
}
/**
@@ -583,7 +587,11 @@ public final class QuestState
*/
public int getMemoState()
{
- return isStarted() ? getInt("memoState") : 0;
+ if (isStarted())
+ {
+ return getInt("memoState");
+ }
+ return 0;
}
public boolean isMemoState(int memoState)
@@ -598,7 +606,11 @@ public final class QuestState
*/
public int getMemoStateEx(int slot)
{
- return isStarted() ? getInt("memoStateEx" + slot) : 0;
+ if (isStarted())
+ {
+ return getInt("memoStateEx" + slot);
+ }
+ return 0;
}
/**
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/skills/AbnormalType.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/skills/AbnormalType.java
index 33f62f052b..35cd7fd2cd 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/skills/AbnormalType.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/skills/AbnormalType.java
@@ -375,6 +375,8 @@ public enum AbnormalType
ELEMENTAL_RESISTANCE_ISS,
HOLY_ATTACK_RESISTANCE_ISS,
MENTAL_ATTACK_RESISTANCE_ISS,
+ CRIPPLING_ATTACK,
+ SHADOW_BLADE,
SIGEL_AURA,
FEOH_STANCE,
YUL_STANCE,
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
index 378f843a95..3c80c47469 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/zone/type/L2EffectZone.java
@@ -31,7 +31,6 @@ import com.l2jmobius.gameserver.model.zone.TaskZoneSettings;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.network.serverpackets.EtcStatusUpdate;
import com.l2jmobius.util.Rnd;
-import com.l2jmobius.util.StringUtil;
/**
* another type of damage zone with skills
@@ -96,7 +95,7 @@ public class L2EffectZone extends L2ZoneType
final String[] skillSplit = skill.split("-");
if (skillSplit.length != 2)
{
- _log.warning(StringUtil.concat(getClass().getSimpleName() + ": invalid config property -> skillsIdLvl \"", skill, "\""));
+ _log.warning(getClass().getSimpleName() + ": invalid config property -> skillsIdLvl \"" + skill + "\"");
}
else
{
@@ -108,7 +107,7 @@ public class L2EffectZone extends L2ZoneType
{
if (!skill.isEmpty())
{
- _log.warning(StringUtil.concat(getClass().getSimpleName() + ": invalid config property -> skillsIdLvl \"", skillSplit[0], "\"", skillSplit[1]));
+ _log.warning(getClass().getSimpleName() + ": invalid config property -> skillsIdLvl \"" + skillSplit[0] + "\"" + skillSplit[1]);
}
}
}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/zone/type/L2ScriptZone.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/zone/type/L2ScriptZone.java
index af3b8d9707..d33223aa10 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/zone/type/L2ScriptZone.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/model/zone/type/L2ScriptZone.java
@@ -21,7 +21,7 @@ import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.ZoneId;
/**
- * A scripted zone... Creation of such a zone should require somekind of jython script reference which can handle onEnter() / onExit()
+ * A scripted zone... Creation of such a zone should require somekind of script reference which can handle onEnter() / onExit()
* @author durgus
*/
public class L2ScriptZone extends L2ZoneType
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/network/clientpackets/RequestSendPost.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/network/clientpackets/RequestSendPost.java
index 0fb3cdbab5..8da980f294 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/network/clientpackets/RequestSendPost.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/network/clientpackets/RequestSendPost.java
@@ -38,7 +38,6 @@ import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jmobius.gameserver.network.serverpackets.ItemList;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
-import com.l2jmobius.util.StringUtil;
/**
* @author Migi, DS
@@ -316,7 +315,7 @@ public final class RequestSendPost extends L2GameClientPacket
}
final StringBuilder recv = new StringBuilder(32);
- StringUtil.append(recv, msg.getReceiverName(), "[", String.valueOf(msg.getReceiverId()), "]");
+ recv.append(msg.getReceiverName() + "[" + msg.getReceiverId() + "]");
final String receiver = recv.toString();
// Proceed to the transfer
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/network/serverpackets/ExUserInfoFishing.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/network/serverpackets/ExUserInfoFishing.java
new file mode 100644
index 0000000000..98d998c4b9
--- /dev/null
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/network/serverpackets/ExUserInfoFishing.java
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.gameserver.network.serverpackets;
+
+import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * @author Sdw
+ */
+public class ExUserInfoFishing extends L2GameServerPacket
+{
+ private final L2PcInstance _activeChar;
+
+ public ExUserInfoFishing(L2PcInstance activeChar)
+ {
+ _activeChar = activeChar;
+ }
+
+ @Override
+ protected final void writeImpl()
+ {
+ writeC(0xFE);
+ writeH(0x159);
+ writeD(_activeChar.getObjectId());
+ writeC(_activeChar.isFishing() ? 1 : 0);
+ writeD(_activeChar.getFishx());
+ writeD(_activeChar.getFishy());
+ writeD(_activeChar.getFishz());
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/network/serverpackets/ShowBoard.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/network/serverpackets/ShowBoard.java
index 12376f84f7..6a0b26d292 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/network/serverpackets/ShowBoard.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/network/serverpackets/ShowBoard.java
@@ -18,8 +18,6 @@ package com.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
-import com.l2jmobius.util.StringUtil;
-
public class ShowBoard extends L2GameServerPacket
{
private final String _content;
@@ -41,7 +39,7 @@ public class ShowBoard extends L2GameServerPacket
public ShowBoard(List arg)
{
- final StringBuilder builder = new StringBuilder(5 + StringUtil.getLength(arg) + arg.size()).append("1002\u0008");
+ StringBuilder builder = new StringBuilder(256).append("1002\u0008");
for (String str : arg)
{
builder.append(str).append("\u0008");
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/pathfinding/cellnodes/CellPathFinding.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/pathfinding/cellnodes/CellPathFinding.java
index 67e430f6cf..0555054370 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/pathfinding/cellnodes/CellPathFinding.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/pathfinding/cellnodes/CellPathFinding.java
@@ -31,7 +31,6 @@ import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.pathfinding.AbstractNode;
import com.l2jmobius.gameserver.pathfinding.AbstractNodeLoc;
import com.l2jmobius.gameserver.pathfinding.PathFinding;
-import com.l2jmobius.util.StringUtil;
/**
* @author Sami, DS Credits to Diamond
@@ -359,16 +358,32 @@ public class CellPathFinding extends PathFinding
@Override
public String toString()
{
- final StringBuilder stat = new StringBuilder(100);
- StringUtil.append(stat, String.valueOf(mapSize), "x", String.valueOf(mapSize), " num:", String.valueOf(bufs.size()), "/", String.valueOf(count), " uses:", String.valueOf(uses), "/", String.valueOf(playableUses));
+ final StringBuilder sb = new StringBuilder(100);
+ sb.append(mapSize);
+ sb.append("x");
+ sb.append(mapSize);
+ sb.append(" num:");
+ sb.append(bufs.size());
+ sb.append("/");
+ sb.append(count);
+ sb.append(" uses:");
+ sb.append(uses);
+ sb.append("/");
+ sb.append(playableUses);
if (uses > 0)
{
- StringUtil.append(stat, " total/avg(ms):", String.valueOf(elapsed), "/", String.format("%1.2f", (double) elapsed / uses));
+ sb.append(" total/avg(ms):");
+ sb.append(elapsed);
+ sb.append("/");
+ sb.append(String.format("%1.2f", (double) elapsed / uses));
}
- StringUtil.append(stat, " ovf:", String.valueOf(overflows), "/", String.valueOf(playableOverflows));
+ sb.append(" ovf:");
+ sb.append(overflows);
+ sb.append("/");
+ sb.append(playableOverflows);
- return stat.toString();
+ return sb.toString();
}
}
@@ -381,14 +396,28 @@ public class CellPathFinding extends PathFinding
result[i] = _allBuffers[i].toString();
}
- final StringBuilder stat = new StringBuilder(100);
- StringUtil.append(stat, "LOS postfilter uses:", String.valueOf(_postFilterUses), "/", String.valueOf(_postFilterPlayableUses));
+ final StringBuilder sb = new StringBuilder(128);
+ sb.append("LOS postfilter uses:");
+ sb.append(_postFilterUses);
+ sb.append("/");
+ sb.append(_postFilterPlayableUses);
if (_postFilterUses > 0)
{
- StringUtil.append(stat, " total/avg(ms):", String.valueOf(_postFilterElapsed), "/", String.format("%1.2f", (double) _postFilterElapsed / _postFilterUses), " passes total/avg:", String.valueOf(_postFilterPasses), "/", String.format("%1.1f", (double) _postFilterPasses / _postFilterUses), Config.EOL);
+ sb.append(" total/avg(ms):");
+ sb.append(_postFilterElapsed);
+ sb.append("/");
+ sb.append(String.format("%1.2f", (double) _postFilterElapsed / _postFilterUses));
+ sb.append(" passes total/avg:");
+ sb.append(_postFilterPasses);
+ sb.append("/");
+ sb.append(String.format("%1.1f", (double) _postFilterPasses / _postFilterUses));
+ sb.append(Config.EOL);
}
- StringUtil.append(stat, "Pathfind success/fail:", String.valueOf(_findSuccess), "/", String.valueOf(_findFails));
- result[result.length - 1] = stat.toString();
+ sb.append("Pathfind success/fail:");
+ sb.append(_findSuccess);
+ sb.append("/");
+ sb.append(_findFails);
+ result[result.length - 1] = sb.toString();
return result;
}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java
index 984d27cfed..683a40e221 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java
@@ -46,7 +46,7 @@ public final class JavaExecutionContext extends AbstractExecutionContext list, final String nullChecked, final String before)
+ private boolean addOptionIfNotNull(List list, String nullChecked, String before)
{
if (nullChecked == null)
{
@@ -93,15 +93,14 @@ public final class JavaExecutionContext extends AbstractExecutionContext executeScripts(final Iterable sourcePaths) throws Exception
+ public Map executeScripts(Iterable sourcePaths) throws Exception
{
final DiagnosticCollector fileManagerDiagnostics = new DiagnosticCollector<>();
final DiagnosticCollector compilationDiagnostics = new DiagnosticCollector<>();
try (final ScriptingFileManager fileManager = new ScriptingFileManager(getScriptingEngine().getCompiler().getStandardFileManager(fileManagerDiagnostics, null, StandardCharsets.UTF_8)))
{
- final LinkedList options = new LinkedList<>();
-
+ final List options = new LinkedList<>();
addOptionIfNotNull(options, getProperty("source"), "-source");
addOptionIfNotNull(options, getProperty("sourcepath"), "-sourcepath");
if (!addOptionIfNotNull(options, getProperty("cp"), "-cp") && !addOptionIfNotNull(options, getProperty("classpath"), "-classpath"))
@@ -172,11 +171,11 @@ public final class JavaExecutionContext extends AbstractExecutionContext executionFailures = new LinkedHashMap<>();
final Iterable compiledClasses = fileManager.getCompiledClasses();
- for (final Path sourcePath : sourcePaths)
+ for (Path sourcePath : sourcePaths)
{
boolean found = false;
- for (final ScriptingOutputFileObject compiledClass : compiledClasses)
+ for (ScriptingOutputFileObject compiledClass : compiledClasses)
{
Path compiledSourcePath = compiledClass.getSourcePath();
// sourePath can be relative, so we have to use endsWith
@@ -223,7 +222,7 @@ public final class JavaExecutionContext extends AbstractExecutionContext executeScript(final Path sourcePath) throws Exception
+ public Entry executeScript(Path sourcePath) throws Exception
{
final Map executionFailures = executeScripts(Arrays.asList(sourcePath));
if (!executionFailures.isEmpty())
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/util/FloodProtectorAction.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/util/FloodProtectorAction.java
index 2c4ac90e89..ef4c3932f4 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/util/FloodProtectorAction.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/util/FloodProtectorAction.java
@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.util;
+import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -27,7 +28,6 @@ import com.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import com.l2jmobius.gameserver.model.punishment.PunishmentTask;
import com.l2jmobius.gameserver.model.punishment.PunishmentType;
import com.l2jmobius.gameserver.network.L2GameClient;
-import com.l2jmobius.util.StringUtil;
/**
* Flood protector implementation.
@@ -189,7 +189,9 @@ public final class FloodProtectorAction
private void log(String... lines)
{
- final StringBuilder output = StringUtil.startAppend(100, _config.FLOOD_PROTECTOR_TYPE, ": ");
+ final StringBuilder output = new StringBuilder(100);
+ output.append(_config.FLOOD_PROTECTOR_TYPE);
+ output.append(": ");
String address = null;
try
{
@@ -208,8 +210,10 @@ public final class FloodProtectorAction
{
if (_client.getActiveChar() != null)
{
- StringUtil.append(output, _client.getActiveChar().getName());
- StringUtil.append(output, "(", String.valueOf(_client.getActiveChar().getObjectId()), ") ");
+ output.append(_client.getActiveChar().getName());
+ output.append("(");
+ output.append(_client.getActiveChar().getObjectId());
+ output.append(") ");
}
break;
}
@@ -217,7 +221,8 @@ public final class FloodProtectorAction
{
if (_client.getAccountName() != null)
{
- StringUtil.append(output, _client.getAccountName(), " ");
+ output.append(_client.getAccountName());
+ output.append(" ");
}
break;
}
@@ -225,7 +230,7 @@ public final class FloodProtectorAction
{
if (address != null)
{
- StringUtil.append(output, address);
+ output.append(address);
}
break;
}
@@ -235,7 +240,8 @@ public final class FloodProtectorAction
}
}
- StringUtil.append(output, lines);
+ Arrays.stream(lines).forEach(output::append);
+
_log.warning(output.toString());
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/util/HtmlUtil.java b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/util/HtmlUtil.java
index 1ffc6f3808..391e38d5e7 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/gameserver/util/HtmlUtil.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/gameserver/util/HtmlUtil.java
@@ -21,7 +21,6 @@ import java.util.Collection;
import java.util.function.Function;
import com.l2jmobius.gameserver.model.PageResult;
-import com.l2jmobius.util.StringUtil;
/**
* A class containing useful methods for constructing HTML
@@ -163,20 +162,62 @@ public class HtmlUtil
{
current = Math.min(current, max);
final StringBuilder sb = new StringBuilder();
- StringUtil.append(sb, "");
- StringUtil.append(sb, " ");
- StringUtil.append(sb, " ");
+ sb.append("");
+ sb.append("");
+ sb.append("");
+ sb.append(" ");
+ sb.append(" ");
+ sb.append(" ");
+ sb.append("");
+ sb.append("");
+ sb.append("");
+ sb.append("");
+ sb.append("");
if (displayAsPercentage)
{
- StringUtil.append(sb, "", String.format("%.2f%%", ((double) current / max) * 100), "
");
+ sb.append("");
+ sb.append("");
+ sb.append(String.format("%.2f%%", ((double) current / max) * 100));
+ sb.append(" ");
+ sb.append("
");
}
else
{
- final String tdWidth = String.valueOf((width - 10) / 2);
- StringUtil.append(sb, "", String.valueOf(current), " ");
- StringUtil.append(sb, "/ ", String.valueOf(max), "
");
+ int tdWidth = (width - 10) / 2;
+ sb.append("");
+ sb.append("");
+ sb.append("");
+ sb.append(current);
+ sb.append(" ");
+ sb.append("/ ");
+ sb.append("");
+ sb.append(max);
+ sb.append(" ");
+ sb.append(" ");
+ sb.append("
");
}
- StringUtil.append(sb, "
");
+ sb.append(" ");
+ sb.append(" ");
+ sb.append("
");
+ sb.append(" ");
+ sb.append(" ");
+ sb.append("
");
return sb.toString();
}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/AbstractFormatter.java b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/AbstractFormatter.java
new file mode 100644
index 0000000000..4bbc276c13
--- /dev/null
+++ b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/AbstractFormatter.java
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.log.formatter;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.logging.Formatter;
+import java.util.logging.LogRecord;
+
+/**
+ * @author Nos
+ */
+public abstract class AbstractFormatter extends Formatter
+{
+ private final DateFormat _dateFormat = new SimpleDateFormat("dd/MM HH:mm:ss");
+
+ @Override
+ public String format(LogRecord record)
+ {
+ final StringBuilder sb = new StringBuilder(32);
+ sb.append("[");
+ sb.append(_dateFormat.format(new Date(record.getMillis())));
+ sb.append("] ");
+ sb.append(record.getMessage());
+ return sb.toString();
+ }
+}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/AccountingFormatter.java b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/AccountingFormatter.java
index 59ddad3604..5fa2774b2f 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/AccountingFormatter.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/AccountingFormatter.java
@@ -1,114 +1,105 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.log.formatter;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jmobius.gameserver.network.L2GameClient;
-import com.l2jmobius.util.StringUtil;
-
-public class AccountingFormatter extends Formatter
-{
- private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
-
- @Override
- public String format(LogRecord record)
- {
- final Object[] params = record.getParameters();
- final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params == null ? 0 : params.length * 10), "[", dateFmt.format(new Date(record.getMillis())), "] ", record.getMessage());
-
- if (params != null)
- {
- for (Object p : params)
- {
- if (p == null)
- {
- continue;
- }
-
- StringUtil.append(output, ", ");
-
- if (p instanceof L2GameClient)
- {
- final L2GameClient client = (L2GameClient) p;
- String address = null;
- try
- {
- if (!client.isDetached())
- {
- address = client.getConnection().getInetAddress().getHostAddress();
- }
- }
- catch (Exception e)
- {
- }
-
- switch (client.getState())
- {
- case IN_GAME:
- {
- if (client.getActiveChar() != null)
- {
- StringUtil.append(output, client.getActiveChar().getName());
- StringUtil.append(output, "(", String.valueOf(client.getActiveChar().getObjectId()), ") ");
- }
- break;
- }
- case AUTHED:
- {
- if (client.getAccountName() != null)
- {
- StringUtil.append(output, client.getAccountName(), " ");
- }
- break;
- }
- case CONNECTED:
- {
- if (address != null)
- {
- StringUtil.append(output, address);
- }
- break;
- }
- default:
- {
- throw new IllegalStateException("Missing state on switch");
- }
- }
- }
- else if (p instanceof L2PcInstance)
- {
- final L2PcInstance player = (L2PcInstance) p;
- StringUtil.append(output, player.getName());
- StringUtil.append(output, "(", String.valueOf(player.getObjectId()), ")");
- }
- else
- {
- StringUtil.append(output, p.toString());
- }
- }
- }
-
- output.append(Config.EOL);
- return output.toString();
- }
-}
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.log.formatter;
+
+import java.util.logging.LogRecord;
+
+import com.l2jmobius.Config;
+import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jmobius.gameserver.network.L2GameClient;
+
+public class AccountingFormatter extends AbstractFormatter
+{
+ @Override
+ public String format(LogRecord record)
+ {
+ final Object[] params = record.getParameters();
+ final StringBuilder output = new StringBuilder(32 + record.getMessage().length() + (params != null ? 10 * params.length : 0));
+ output.append(super.format(record));
+
+ if (params != null)
+ {
+ for (Object p : params)
+ {
+ if (p == null)
+ {
+ continue;
+ }
+
+ output.append(", ");
+
+ if (p instanceof L2GameClient)
+ {
+ final L2GameClient client = (L2GameClient) p;
+ String address = null;
+ try
+ {
+ if (!client.isDetached())
+ {
+ address = client.getConnection().getInetAddress().getHostAddress();
+ }
+ }
+ catch (Exception e)
+ {
+
+ }
+
+ switch (client.getState())
+ {
+ case IN_GAME:
+ if (client.getActiveChar() != null)
+ {
+ output.append(client.getActiveChar().getName());
+ output.append("(");
+ output.append(client.getActiveChar().getObjectId());
+ output.append(") ");
+ }
+ case AUTHED:
+ if (client.getAccountName() != null)
+ {
+ output.append(client.getAccountName());
+ output.append(" ");
+ }
+ case CONNECTED:
+ if (address != null)
+ {
+ output.append(address);
+ }
+ break;
+ default:
+ throw new IllegalStateException("Missing state on switch");
+ }
+ }
+ else if (p instanceof L2PcInstance)
+ {
+ L2PcInstance player = (L2PcInstance) p;
+ output.append(player.getName());
+ output.append("(");
+ output.append(player.getObjectId());
+ output.append(")");
+ }
+ else
+ {
+ output.append(p);
+ }
+ }
+ }
+
+ output.append(Config.EOL);
+ return output.toString();
+ }
+}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/AuditFormatter.java b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/AuditFormatter.java
index 6fa2f02003..b241ef1ea2 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/AuditFormatter.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/AuditFormatter.java
@@ -1,55 +1,51 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.log.formatter;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.util.StringUtil;
-
-/**
- * @author zabbix
- */
-public class AuditFormatter extends Formatter
-{
- private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
-
- @Override
- public String format(LogRecord record)
- {
- final Object[] params = record.getParameters();
- final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params == null ? 0 : params.length * 10), "[", dateFmt.format(new Date(record.getMillis())), "] ", record.getMessage());
-
- if (params != null)
- {
- for (Object p : params)
- {
- if (p == null)
- {
- continue;
- }
- StringUtil.append(output, ", ", p.toString());
- }
- }
-
- output.append(Config.EOL);
- return output.toString();
- }
-}
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.log.formatter;
+
+import java.util.logging.LogRecord;
+
+import com.l2jmobius.Config;
+
+/**
+ * @author zabbix
+ */
+public class AuditFormatter extends AbstractFormatter
+{
+ @Override
+ public String format(LogRecord record)
+ {
+ final Object[] params = record.getParameters();
+ final StringBuilder output = new StringBuilder(32 + record.getMessage().length() + (params != null ? 10 * params.length : 0));
+ output.append(super.format(record));
+
+ if (params != null)
+ {
+ for (Object p : params)
+ {
+ if (p == null)
+ {
+ continue;
+ }
+ output.append(", ");
+ output.append(p);
+ }
+ }
+ output.append(Config.EOL);
+
+ return output.toString();
+ }
+}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ChatLogFormatter.java b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ChatLogFormatter.java
index de2f9a69ce..618be791a9 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ChatLogFormatter.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ChatLogFormatter.java
@@ -1,49 +1,46 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.log.formatter;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.util.StringUtil;
-
-public class ChatLogFormatter extends Formatter
-{
- private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
-
- @Override
- public String format(LogRecord record)
- {
- final Object[] params = record.getParameters();
- final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params != null ? 10 * params.length : 0), "[", dateFmt.format(new Date(record.getMillis())), "] ");
-
- if (params != null)
- {
- for (Object p : params)
- {
- StringUtil.append(output, String.valueOf(p), " ");
- }
- }
-
- StringUtil.append(output, record.getMessage(), Config.EOL);
-
- return output.toString();
- }
-}
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.log.formatter;
+
+import java.util.logging.LogRecord;
+
+import com.l2jmobius.Config;
+
+public class ChatLogFormatter extends AbstractFormatter
+{
+ @Override
+ public String format(LogRecord record)
+ {
+ Object[] params = record.getParameters();
+ final StringBuilder output = new StringBuilder(32 + record.getMessage().length() + (params != null ? 10 * params.length : 0));
+ output.append(super.format(record));
+
+ if (params != null)
+ {
+ for (Object p : params)
+ {
+ output.append(p);
+ output.append(" ");
+ }
+ }
+
+ output.append(record.getMessage());
+ output.append(Config.EOL);
+
+ return output.toString();
+ }
+}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ConsoleLogFormatter.java b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ConsoleLogFormatter.java
index dc7ae7dcde..4c6df871f9 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ConsoleLogFormatter.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ConsoleLogFormatter.java
@@ -1,50 +1,46 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.log.formatter;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.util.StringUtil;
-import com.l2jmobius.util.Util;
-
-public class ConsoleLogFormatter extends Formatter
-{
- private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd/MM HH:mm:ss");
-
- @Override
- public String format(LogRecord record)
- {
- final StringBuilder output = new StringBuilder(500);
- StringUtil.append(output, "[", dateFmt.format(new Date(record.getMillis())), "] " + record.getMessage(), Config.EOL);
-
- if (record.getThrown() != null)
- {
- try
- {
- StringUtil.append(output, Util.getStackTrace(record.getThrown()), Config.EOL);
- }
- catch (Exception ex)
- {
- }
- }
- return output.toString();
- }
-}
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.log.formatter;
+
+import java.util.logging.LogRecord;
+
+import com.l2jmobius.Config;
+import com.l2jmobius.util.Util;
+
+public class ConsoleLogFormatter extends AbstractFormatter
+{
+ @Override
+ public String format(LogRecord record)
+ {
+ final StringBuilder output = new StringBuilder(128);
+ output.append(super.format(record));
+ output.append(Config.EOL);
+
+ if (record.getThrown() != null)
+ {
+ try
+ {
+ output.append(Util.getStackTrace(record.getThrown()));
+ output.append(Config.EOL);
+ }
+ catch (Exception ex)
+ {
+ }
+ }
+ return output.toString();
+ }
+}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/DamageFormatter.java b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/DamageFormatter.java
index 1f3369e6d1..30ed950ea2 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/DamageFormatter.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/DamageFormatter.java
@@ -1,84 +1,89 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.log.formatter;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.model.actor.L2Attackable;
-import com.l2jmobius.gameserver.model.actor.L2Character;
-import com.l2jmobius.gameserver.model.actor.L2Summon;
-import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jmobius.gameserver.model.skills.Skill;
-import com.l2jmobius.util.StringUtil;
-
-public class DamageFormatter extends Formatter
-{
- private final SimpleDateFormat dateFmt = new SimpleDateFormat("yy.MM.dd H:mm:ss");
-
- @Override
- public String format(LogRecord record)
- {
- final Object[] params = record.getParameters();
- final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params == null ? 0 : params.length * 10), "[", dateFmt.format(new Date(record.getMillis())), "] '---': ", record.getMessage());
-
- if (params != null)
- {
- for (Object p : params)
- {
- if (p == null)
- {
- continue;
- }
-
- if (p instanceof L2Character)
- {
- if ((p instanceof L2Attackable) && ((L2Attackable) p).isRaid())
- {
- StringUtil.append(output, "RaidBoss ");
- }
-
- StringUtil.append(output, ((L2Character) p).getName(), "(", String.valueOf(((L2Character) p).getObjectId()), ") ");
- StringUtil.append(output, String.valueOf(((L2Character) p).getLevel()), " lvl");
-
- if (p instanceof L2Summon)
- {
- final L2PcInstance owner = ((L2Summon) p).getOwner();
- if (owner != null)
- {
- StringUtil.append(output, " Owner:", owner.getName(), "(", String.valueOf(owner.getObjectId()), ")");
- }
- }
- }
- else if (p instanceof Skill)
- {
- StringUtil.append(output, " with skill ", ((Skill) p).getName(), "(", String.valueOf(((Skill) p).getId()), ")");
- }
- else
- {
- StringUtil.append(output, p.toString());
- }
- }
- }
-
- output.append(Config.EOL);
- return output.toString();
- }
-}
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.log.formatter;
+
+import java.util.logging.LogRecord;
+
+import com.l2jmobius.Config;
+import com.l2jmobius.gameserver.model.actor.L2Attackable;
+import com.l2jmobius.gameserver.model.actor.L2Character;
+import com.l2jmobius.gameserver.model.actor.L2Summon;
+import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jmobius.gameserver.model.skills.Skill;
+
+public class DamageFormatter extends AbstractFormatter
+{
+ @Override
+ public String format(LogRecord record)
+ {
+ final Object[] params = record.getParameters();
+ final StringBuilder output = new StringBuilder(32 + record.getMessage().length() + (params != null ? 10 * params.length : 0));
+ output.append(super.format(record));
+
+ if (params != null)
+ {
+ for (Object p : params)
+ {
+ if (p == null)
+ {
+ continue;
+ }
+
+ if (p instanceof L2Character)
+ {
+ final L2Character creature = (L2Character) p;
+ if ((p instanceof L2Attackable) && ((L2Attackable) p).isRaid())
+ {
+ output.append("RaidBoss ");
+ }
+
+ output.append(creature.getName());
+ output.append("(");
+ output.append(creature.getObjectId());
+ output.append(") ");
+ output.append(creature.getLevel());
+ output.append(" lvl");
+
+ if (p instanceof L2Summon)
+ {
+ L2PcInstance owner = ((L2Summon) p).getOwner();
+ if (owner != null)
+ {
+ output.append(" Owner:");
+ output.append(owner.getName());
+ output.append("(");
+ output.append(owner.getObjectId());
+ output.append(")");
+ }
+ }
+ }
+ else if (p instanceof Skill)
+ {
+ output.append(" with skill ");
+ output.append(p);
+ }
+ else
+ {
+ output.append(p);
+ }
+ }
+ }
+
+ output.append(Config.EOL);
+ return output.toString();
+ }
+}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/EnchantFormatter.java b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/EnchantFormatter.java
index 9fa1bb9fe8..e9604e83a6 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/EnchantFormatter.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/EnchantFormatter.java
@@ -1,89 +1,104 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.log.formatter;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
-import com.l2jmobius.gameserver.model.skills.Skill;
-import com.l2jmobius.util.StringUtil;
-
-public class EnchantFormatter extends Formatter
-{
- private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
-
- @Override
- public String format(LogRecord record)
- {
- final Object[] params = record.getParameters();
- final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params == null ? 0 : params.length * 10), "[", dateFmt.format(new Date(record.getMillis())), "] ", record.getMessage());
-
- if (params != null)
- {
- for (Object p : params)
- {
- if (p == null)
- {
- continue;
- }
-
- StringUtil.append(output, ", ");
-
- if (p instanceof L2PcInstance)
- {
- final L2PcInstance player = (L2PcInstance) p;
- StringUtil.append(output, "Character:", player.getName(), " [" + String.valueOf(player.getObjectId()) + "] Account:", player.getAccountName());
- if ((player.getClient() != null) && !player.getClient().isDetached())
- {
- StringUtil.append(output, " IP:", player.getClient().getConnection().getInetAddress().getHostAddress());
- }
- }
- else if (p instanceof L2ItemInstance)
- {
- final L2ItemInstance item = (L2ItemInstance) p;
- if (item.getEnchantLevel() > 0)
- {
- StringUtil.append(output, "+", String.valueOf(item.getEnchantLevel()), " ");
- }
- StringUtil.append(output, item.getItem().getName(), "(", String.valueOf(item.getCount()), ")");
- StringUtil.append(output, " [", String.valueOf(item.getObjectId()), "]");
- }
- else if (p instanceof Skill)
- {
- final Skill skill = (Skill) p;
- if (skill.getLevel() > 100)
- {
- StringUtil.append(output, "+", String.valueOf(skill.getLevel() % 100), " ");
- }
- StringUtil.append(output, skill.getName(), "(", String.valueOf(skill.getId()), " ", String.valueOf(skill.getLevel()), ")");
- }
- else
- {
- StringUtil.append(output, p.toString());
- }
- }
- }
-
- output.append(Config.EOL);
- return output.toString();
- }
-}
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.log.formatter;
+
+import java.util.logging.LogRecord;
+
+import com.l2jmobius.Config;
+import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
+import com.l2jmobius.gameserver.model.skills.Skill;
+
+public class EnchantFormatter extends AbstractFormatter
+{
+ @Override
+ public String format(LogRecord record)
+ {
+ final Object[] params = record.getParameters();
+ final StringBuilder output = new StringBuilder(32 + record.getMessage().length() + (params != null ? 10 * params.length : 0));
+ output.append(super.format(record));
+
+ if (params != null)
+ {
+ for (Object p : params)
+ {
+ if (p == null)
+ {
+ continue;
+ }
+
+ output.append(", ");
+
+ if (p instanceof L2PcInstance)
+ {
+ L2PcInstance player = (L2PcInstance) p;
+ output.append("Character:");
+ output.append(player.getName());
+ output.append(" [");
+ output.append(player.getObjectId());
+ output.append("] Account:");
+ output.append(player.getAccountName());
+ if ((player.getClient() != null) && !player.getClient().isDetached())
+ {
+ output.append(" IP:");
+ output.append(player.getClient().getConnection().getInetAddress().getHostAddress());
+ }
+ }
+ else if (p instanceof L2ItemInstance)
+ {
+ L2ItemInstance item = (L2ItemInstance) p;
+ if (item.getEnchantLevel() > 0)
+ {
+ output.append("+");
+ output.append(item.getEnchantLevel());
+ output.append(" ");
+ }
+ output.append(item.getItem().getName());
+ output.append("(");
+ output.append(item.getCount());
+ output.append(")");
+ output.append(" [");
+ output.append(item.getObjectId());
+ output.append("]");
+ }
+ else if (p instanceof Skill)
+ {
+ Skill skill = (Skill) p;
+ if (skill.getLevel() > 100)
+ {
+ output.append("+");
+ output.append(skill.getLevel() % 100);
+ output.append(" ");
+ }
+ output.append(skill.getName());
+ output.append("(");
+ output.append(skill.getId());
+ output.append(" ");
+ output.append(skill.getLevel());
+ output.append(")");
+ }
+ else
+ {
+ output.append(p);
+ }
+ }
+ }
+
+ output.append(Config.EOL);
+ return output.toString();
+ }
+}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/FileLogFormatter.java b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/FileLogFormatter.java
index 9cc1217c8d..a9c12d1d90 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/FileLogFormatter.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/FileLogFormatter.java
@@ -1,41 +1,46 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.log.formatter;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.util.StringUtil;
-
-/**
- * This class ...
- * @version $Revision: 1.1.4.1 $ $Date: 2005/03/27 15:30:08 $
- */
-public class FileLogFormatter extends Formatter
-{
- private static final String TAB = "\t";
- private final SimpleDateFormat dateFmt = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss,SSS");
-
- @Override
- public String format(LogRecord record)
- {
- return StringUtil.concat(dateFmt.format(new Date(record.getMillis())), TAB, record.getLevel().getName(), TAB, String.valueOf(record.getThreadID()), TAB, record.getLoggerName(), TAB, record.getMessage(), Config.EOL);
- }
-}
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.log.formatter;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.StringJoiner;
+import java.util.logging.Formatter;
+import java.util.logging.LogRecord;
+
+import com.l2jmobius.Config;
+
+/**
+ * This class ...
+ * @version $Revision: 1.1.4.1 $ $Date: 2005/03/27 15:30:08 $
+ */
+public class FileLogFormatter extends Formatter
+{
+ private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss,SSS");
+
+ @Override
+ public String format(LogRecord record)
+ {
+ final StringJoiner sj = new StringJoiner("\t", "", Config.EOL);
+ sj.add(dateFormat.format(new Date(record.getMillis())));
+ sj.add(record.getLevel().getName());
+ sj.add(String.valueOf(record.getThreadID()));
+ sj.add(record.getLoggerName());
+ sj.add(record.getMessage());
+ return sj.toString();
+ }
+}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ItemLogFormatter.java b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ItemLogFormatter.java
index da2cf80628..01c994a5dc 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ItemLogFormatter.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/ItemLogFormatter.java
@@ -1,70 +1,70 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.log.formatter;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
-import com.l2jmobius.util.StringUtil;
-
-/**
- * @author Advi
- */
-public class ItemLogFormatter extends Formatter
-{
- private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
-
- @Override
- public String format(LogRecord record)
- {
- final Object[] params = record.getParameters();
- final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params.length * 50), "[", dateFmt.format(new Date(record.getMillis())), "] ", record.getMessage());
-
- for (Object p : record.getParameters())
- {
- if (p == null)
- {
- continue;
- }
- output.append(", ");
- if (p instanceof L2ItemInstance)
- {
- final L2ItemInstance item = (L2ItemInstance) p;
- StringUtil.append(output, "item ", String.valueOf(item.getObjectId()), ":");
- if (item.getEnchantLevel() > 0)
- {
- StringUtil.append(output, "+", String.valueOf(item.getEnchantLevel()), " ");
- }
-
- StringUtil.append(output, item.getItem().getName(), "(", String.valueOf(item.getCount()), ")");
- }
- // else if (p instanceof L2PcInstance)
- // output.append(((L2PcInstance)p).getName());
- else
- {
- output.append(p.toString()/* + ":" + ((L2Object)p).getObjectId() */);
- }
- }
- output.append(Config.EOL);
-
- return output.toString();
- }
-}
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.log.formatter;
+
+import java.util.logging.LogRecord;
+
+import com.l2jmobius.Config;
+import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
+
+/**
+ * @author Advi
+ */
+public class ItemLogFormatter extends AbstractFormatter
+{
+ @Override
+ public String format(LogRecord record)
+ {
+ final Object[] params = record.getParameters();
+ final StringBuilder output = new StringBuilder(32 + record.getMessage().length() + (params != null ? 10 * params.length : 0));
+ output.append(super.format(record));
+
+ for (Object p : record.getParameters())
+ {
+ if (p == null)
+ {
+ continue;
+ }
+ output.append(", ");
+ if (p instanceof L2ItemInstance)
+ {
+ L2ItemInstance item = (L2ItemInstance) p;
+ output.append("item ");
+ output.append(item.getObjectId());
+ output.append(":");
+ if (item.getEnchantLevel() > 0)
+ {
+ output.append("+");
+ output.append(item.getEnchantLevel());
+ output.append(" ");
+ }
+
+ output.append(item.getItem().getName());
+ output.append("(");
+ output.append(item.getCount());
+ output.append(")");
+ }
+ else
+ {
+ output.append(p);
+ }
+ }
+ output.append(Config.EOL);
+
+ return output.toString();
+ }
+}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/OlympiadFormatter.java b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/OlympiadFormatter.java
index 53caf3c652..23c3192fd6 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/OlympiadFormatter.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/log/formatter/OlympiadFormatter.java
@@ -1,50 +1,47 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.log.formatter;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.util.StringUtil;
-
-public class OlympiadFormatter extends Formatter
-{
- private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd/MM/yyyy H:mm:ss");
-
- @Override
- public String format(LogRecord record)
- {
- final Object[] params = record.getParameters();
- final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params == null ? 0 : params.length * 10), dateFmt.format(new Date(record.getMillis())), ",", record.getMessage());
- if (params != null)
- {
- for (Object p : params)
- {
- if (p == null)
- {
- continue;
- }
- StringUtil.append(output, ",", p.toString());
- }
- }
- output.append(Config.EOL);
- return output.toString();
- }
-}
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.log.formatter;
+
+import java.util.logging.LogRecord;
+
+import com.l2jmobius.Config;
+
+public class OlympiadFormatter extends AbstractFormatter
+{
+ @Override
+ public String format(LogRecord record)
+ {
+ final Object[] params = record.getParameters();
+ final StringBuilder output = new StringBuilder(32 + record.getMessage().length() + (params != null ? 10 * params.length : 0));
+ output.append(super.format(record));
+
+ if (params != null)
+ {
+ for (Object p : params)
+ {
+ if (p == null)
+ {
+ continue;
+ }
+ output.append(",");
+ output.append(p);
+ }
+ }
+ output.append(Config.EOL);
+ return output.toString();
+ }
+}
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/util/StringUtil.java b/L2J_Mobius_Test/java/com/l2jmobius/util/StringUtil.java
deleted file mode 100644
index 87b3119e45..0000000000
--- a/L2J_Mobius_Test/java/com/l2jmobius/util/StringUtil.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.util;
-
-import com.l2jmobius.Config;
-
-/**
- * String utilities optimized for the best performance.
- * How to Use It
- * concat() or append() If concatenating strings
- * in single call, use StringUtil.concat(), otherwise use StringUtil.append()
- * and its variants.
- *
- * Minimum Calls
- * Bad:
- *
- *
- * final StringBuilder sbString = new StringBuilder();
- * StringUtil.append(sbString, "text 1", String.valueOf(npcId));
- * StringUtil.append("text 2");
- *
- *
- * Good:
- *
- *
- * final StringBuilder sbString = new StringBuilder();
- * StringUtil.append(sbString, "text 1", String.valueOf(npcId), "text 2");
- *
- *
- * Why?
- * Because the less calls you do, the less memory re-allocations have to be done
- * so the whole text fits into the memory and less array copy tasks has to be
- * performed. So if using less calls, less memory is used and string concatenation is faster.
- *
- * Size Hints for Loops
- * Bad:
- *
- *
- * final StringBuilder sbString = new StringBuilder();
- * StringUtil.append(sbString, "header start", someText, "header end");
- * for (int i = 0; i < 50; i++)
- * {
- * StringUtil.append(sbString, "text 1", stringArray[i], "text 2");
- * }
- *
- *
- * Good:
- *
- *
- * final StringBuilder sbString = StringUtil.startAppend(1300, "header start", someText, "header end");
- * for (int i = 0; i < 50; i++)
- * {
- * StringUtil.append(sbString, "text 1", stringArray[i], "text 2");
- * }
- *
- *
- * Why?
- * When using StringUtil.append(), memory is only allocated to fit in the strings in method argument. So on each loop new memory for the string has to be allocated and old string has to be copied to the new string. With size hint, even if the size hint is above the needed memory, memory is saved
- * because new memory has not to be allocated on each cycle. Also it is much faster if no string copy tasks has to be performed. So if concatenating strings in a loop, count approximately the size and set it as the hint for the string builder size. It's better to make the size hint little bit larger
- * rather than smaller.
- * In case there is no text appended before the cycle, just use new
- * StringBuilder(1300)
.
- *
- * Concatenation and Constants
- * Bad:
- *
- *
- * StringUtil.concat("text 1 ", "text 2", String.valueOf(npcId));
- *
- *
- * Good:
- *
- *
- * StringUtil.concat("text 1 " + "text 2", String.valueOf(npcId));
- *
- *
- * or
- *
- *
- * StringUtil.concat("text 1 text 2", String.valueOf(npcId));
- *
- *
- * Why?
- * It saves some cycles when determining size of memory that needs to be allocated because less strings are passed to concat() method. But do not use + for concatenation of non-constant strings, that degrades performance and makes extra memory allocations needed.
- * Concatenation and Constant Variables Bad:
- *
- *
- * String glue = "some glue";
- * StringUtil.concat("text 1", glue, "text 2", glue, String.valueOf(npcId));
- *
- *
- * Good:
- *
- *
- * final String glue = "some glue";
- * StringUtil.concat("text 1" + glue + "text2" + glue, String.valueOf(npcId));
- *
- *
- * Why? Because when using final
keyword, the glue
is marked as constant string and compiler treats it as a constant string so it is able to create string "text1some gluetext2some glue" during the compilation. But this only works in case the value is known at compilation
- * time, so this cannot be used for cases like final String objectIdString =
- * String.valueOf(getObjectId)
.
- *
- * StringBuilder Reuse
- * Bad:
- *
- *
- * final StringBuilder sbString1 = new StringBuilder();
- * StringUtil.append(sbString1, "text 1", String.valueOf(npcId), "text 2");
- * ... // output of sbString1, it is no more needed
- * final StringBuilder sbString2 = new StringBuilder();
- * StringUtil.append(sbString2, "text 3", String.valueOf(npcId), "text 4");
- *
- *
- * Good:
- *
- *
- * final StringBuilder sbString = new StringBuilder();
- * StringUtil.append(sbString, "text 1", String.valueOf(npcId), "text 2");
- * ... // output of sbString, it is no more needed
- * sbString.setLength(0);
- * StringUtil.append(sbString, "text 3", String.valueOf(npcId), "text 4");
- *
- *
- * Why?
- * In first case, new memory has to be allocated for the second string. In second case already allocated memory is reused, but only in case the new string is not longer than the previously allocated string. Anyway, the second way is better because the string either fits in the memory and some memory
- * is saved, or it does not fit in the memory, and in that case it works as in the first case.
- * Primitives to Strings To convert primitives to string, use String.valueOf().
- *
- * How much faster is it?
- * Here are some results of my tests. Count is number of strings concatenated. Don't take the numbers as 100% true as the numbers are affected by other programs running on my computer at the same time. Anyway, from the results it is obvious that using StringBuilder with predefined size is the
- * fastest (and also most memory efficient) solution. It is about 5 times faster when concatenating 7 strings, compared to TextBuilder. Also, with more strings concatenated, the difference between StringBuilder and TextBuilder gets larger. In code, there are many cases, where there are concatenated
- * 50+ strings so the time saving is even greater.
- *
- *
- * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
- * String: 1033
- * StringBuilder: 993
- * StringBuilder with size: 1024
- * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
- * String: 2583
- * StringBuilder: 1633
- * StringBuilder with size: 1156
- * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
- * String: 4207
- * StringBuilder: 1816
- * StringBuilder with size: 1444
- * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
- * String: 6937
- * StringBuilder: 2745
- * StringBuilder with size: 1882
- * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
- * String: 9471
- * StringBuilder: 2889
- * StringBuilder with size: 1857
- * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
- * String: 12746
- * StringBuilder: 3081
- * StringBuilder with size: 2139
- *
- *
- * @author fordfrog
- */
-public final class StringUtil
-{
- private StringUtil()
- {
- }
-
- /**
- * Concatenates strings.
- * @param strings strings to be concatenated
- * @return concatenated string
- */
- public static String concat(String... strings)
- {
- final StringBuilder sbString = new StringBuilder();
- for (String string : strings)
- {
- sbString.append(string);
- }
- return sbString.toString();
- }
-
- /**
- * Creates new string builder with size initializated to sizeHint
, unless total length of strings is greater than sizeHint
.
- * @param sizeHint hint for string builder size allocation
- * @param strings strings to be appended
- * @return created string builder
- */
- public static StringBuilder startAppend(int sizeHint, String... strings)
- {
- final int length = getLength(strings);
- final StringBuilder sbString = new StringBuilder(sizeHint > length ? sizeHint : length);
- for (String string : strings)
- {
- sbString.append(string);
- }
- return sbString;
- }
-
- /**
- * Appends strings to existing string builder.
- * @param sbString string builder
- * @param strings strings to be appended
- */
- public static void append(StringBuilder sbString, String... strings)
- {
- sbString.ensureCapacity(sbString.length() + getLength(strings));
-
- for (String string : strings)
- {
- sbString.append(string);
- }
- }
-
- public static int getLength(Iterable strings)
- {
- int length = 0;
- for (String string : strings)
- {
- length += (string == null) ? 4 : string.length();
- }
- return length;
- }
-
- /**
- * Counts total length of all the strings.
- * @param strings array of strings
- * @return total length of all the strings
- */
- public static int getLength(String[] strings)
- {
- int length = 0;
- for (String string : strings)
- {
- length += (string == null) ? 4 : string.length();
- }
- return length;
- }
-
- public static String getTraceString(StackTraceElement[] trace)
- {
- final StringBuilder sbString = new StringBuilder();
- for (StackTraceElement element : trace)
- {
- sbString.append(element.toString()).append(Config.EOL);
- }
- return sbString.toString();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Test/java/com/l2jmobius/util/Util.java b/L2J_Mobius_Test/java/com/l2jmobius/util/Util.java
index 8d59ac58ca..3b11dfd045 100644
--- a/L2J_Mobius_Test/java/com/l2jmobius/util/Util.java
+++ b/L2J_Mobius_Test/java/com/l2jmobius/util/Util.java
@@ -29,8 +29,11 @@ import java.time.temporal.TemporalAdjusters;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
+import java.util.StringJoiner;
import java.util.logging.Logger;
+import com.l2jmobius.Config;
+
/**
* Useful utilities common to L2J Server.
*/
@@ -221,4 +224,14 @@ public final class Util
.orElse(dateNowWithDifferentTime.with(TemporalAdjusters.next(daysOfWeek.get(0))));
// @formatter:on
}
+
+ public static String getTraceString(StackTraceElement[] stackTraceElements)
+ {
+ final StringJoiner sj = new StringJoiner(Config.EOL);
+ for (final StackTraceElement stackTraceElement : stackTraceElements)
+ {
+ sj.add(stackTraceElement.toString());
+ }
+ return sj.toString();
+ }
}