Partial sync latest Test changes to HighFive.
This commit is contained in:
parent
be6443a66a
commit
7b56568b81
@ -137,8 +137,8 @@ public final class Antharas extends AbstractNpcAI
|
||||
addKillId(ANTHARAS, TERASQUE, BEHEMOTH);
|
||||
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ANTHARAS);
|
||||
final int curr_hp = info.getInt("currentHP");
|
||||
final int curr_mp = info.getInt("currentMP");
|
||||
final double curr_hp = info.getDouble("currentHP");
|
||||
final double curr_mp = info.getDouble("currentMP");
|
||||
final int loc_x = info.getInt("loc_x");
|
||||
final int loc_y = info.getInt("loc_y");
|
||||
final int loc_z = info.getInt("loc_z");
|
||||
|
@ -110,8 +110,8 @@ public final class Baium extends AbstractNpcAI
|
||||
addSpellFinishedId(BAIUM);
|
||||
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(BAIUM);
|
||||
final int curr_hp = info.getInt("currentHP");
|
||||
final int curr_mp = info.getInt("currentMP");
|
||||
final double curr_hp = info.getDouble("currentHP");
|
||||
final double curr_mp = info.getDouble("currentMP");
|
||||
final int loc_x = info.getInt("loc_x");
|
||||
final int loc_y = info.getInt("loc_y");
|
||||
final int loc_z = info.getInt("loc_z");
|
||||
|
@ -88,8 +88,8 @@ public final class Core extends AbstractNpcAI
|
||||
final int loc_y = info.getInt("loc_y");
|
||||
final int loc_z = info.getInt("loc_z");
|
||||
final int heading = info.getInt("heading");
|
||||
final int hp = info.getInt("currentHP");
|
||||
final int mp = info.getInt("currentMP");
|
||||
final double hp = info.getDouble("currentHP");
|
||||
final double mp = info.getDouble("currentMP");
|
||||
final L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
core.setCurrentHpMp(hp, mp);
|
||||
spawnBoss(core);
|
||||
|
@ -127,8 +127,8 @@ public final class Orfen extends AbstractNpcAI
|
||||
final int loc_y = info.getInt("loc_y");
|
||||
final int loc_z = info.getInt("loc_z");
|
||||
final int heading = info.getInt("heading");
|
||||
final int hp = info.getInt("currentHP");
|
||||
final int mp = info.getInt("currentMP");
|
||||
double hp = info.getDouble("currentHP");
|
||||
double mp = info.getDouble("currentMP");
|
||||
final L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
orfen.setCurrentHpMp(hp, mp);
|
||||
spawnBoss(orfen);
|
||||
|
@ -118,8 +118,8 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
final int loc_y = QUEEN_Y;
|
||||
final int loc_z = QUEEN_Z;
|
||||
final int heading = info.getInt("heading");
|
||||
final int hp = info.getInt("currentHP");
|
||||
final int mp = info.getInt("currentMP");
|
||||
double hp = info.getDouble("currentHP");
|
||||
double mp = info.getDouble("currentMP");
|
||||
final L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
queen.setCurrentHpMp(hp, mp);
|
||||
spawnBoss(queen);
|
||||
|
@ -154,8 +154,8 @@ public final class Valakas extends AbstractNpcAI
|
||||
final int loc_y = info.getInt("loc_y");
|
||||
final int loc_z = info.getInt("loc_z");
|
||||
final int heading = info.getInt("heading");
|
||||
final int hp = info.getInt("currentHP");
|
||||
final int mp = info.getInt("currentMP");
|
||||
final double hp = info.getDouble("currentHP");
|
||||
final double mp = info.getDouble("currentMP");
|
||||
|
||||
final L2Npc valakas = addSpawn(VALAKAS, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
valakas.teleToLocation(VALAKAS_HIDDEN_LOC);
|
||||
|
@ -16,66 +16,48 @@
|
||||
*/
|
||||
package gracia.instances.SecretArea;
|
||||
|
||||
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
|
||||
import ai.npc.AbstractNpcAI;
|
||||
import instances.AbstractInstance;
|
||||
|
||||
/**
|
||||
* Secret Area in the Keucereus Fortress instance zone.
|
||||
* @author Gladicek
|
||||
*/
|
||||
public final class SecretArea extends AbstractNpcAI
|
||||
public final class SecretArea extends AbstractInstance
|
||||
{
|
||||
protected class SAWorld extends InstanceWorld
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private static final int TEMPLATE_ID = 117;
|
||||
// NPCs
|
||||
private static final int GINBY = 32566;
|
||||
private static final int LELRIKIA = 32567;
|
||||
private static final int ENTER = 0;
|
||||
private static final int EXIT = 1;
|
||||
// Locations
|
||||
private static final Location[] TELEPORTS =
|
||||
{
|
||||
new Location(-23758, -8959, -5384),
|
||||
new Location(-185057, 242821, 1576)
|
||||
};
|
||||
// Misc
|
||||
private static final int TEMPLATE_ID = 117;
|
||||
private static final int ENTER = 0;
|
||||
private static final int EXIT = 1;
|
||||
|
||||
public SecretArea()
|
||||
{
|
||||
super(SecretArea.class.getSimpleName(), "gracia/instances");
|
||||
super(SecretArea.class.getSimpleName());
|
||||
addStartNpc(GINBY);
|
||||
addTalkId(GINBY);
|
||||
addTalkId(LELRIKIA);
|
||||
}
|
||||
|
||||
protected void enterInstance(L2PcInstance player)
|
||||
@Override
|
||||
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
|
||||
{
|
||||
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||
|
||||
if (world != null)
|
||||
if (firstEntrance)
|
||||
{
|
||||
if (world instanceof SAWorld)
|
||||
{
|
||||
teleportPlayer(player, TELEPORTS[ENTER], world.getInstanceId());
|
||||
return;
|
||||
}
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
|
||||
return;
|
||||
world.addAllowed(player.getObjectId());
|
||||
}
|
||||
|
||||
world = new SAWorld();
|
||||
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance("SecretArea.xml"));
|
||||
world.setTemplateId(TEMPLATE_ID);
|
||||
world.addAllowed(player.getObjectId());
|
||||
world.setStatus(0);
|
||||
InstanceManager.getInstance().addWorld(world);
|
||||
teleportPlayer(player, TELEPORTS[ENTER], world.getInstanceId());
|
||||
}
|
||||
|
||||
@ -85,7 +67,7 @@ public final class SecretArea extends AbstractNpcAI
|
||||
final String htmltext = getNoQuestMsg(player);
|
||||
if ((npc.getId() == GINBY) && event.equalsIgnoreCase("enter"))
|
||||
{
|
||||
enterInstance(player);
|
||||
enterInstance(player, "SecretArea.xml", TEMPLATE_ID);
|
||||
return "32566-01.html";
|
||||
}
|
||||
else if ((npc.getId() == LELRIKIA) && event.equalsIgnoreCase("exit"))
|
||||
|
@ -29,7 +29,7 @@ public class L2DoorInstanceActionShift implements IActionShiftHandler
|
||||
@Override
|
||||
public boolean action(L2PcInstance activeChar, L2Object target, boolean interact)
|
||||
{
|
||||
if (activeChar.getAccessLevel().isGm())
|
||||
if (activeChar.isGM())
|
||||
{
|
||||
activeChar.setTarget(target);
|
||||
final L2DoorInstance door = (L2DoorInstance) target;
|
||||
|
@ -22,16 +22,15 @@ import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
public class L2ItemInstanceActionShift implements IActionShiftHandler
|
||||
{
|
||||
@Override
|
||||
public boolean action(L2PcInstance activeChar, L2Object target, boolean interact)
|
||||
{
|
||||
if (activeChar.getAccessLevel().isGm())
|
||||
if (activeChar.isGM())
|
||||
{
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(StringUtil.concat("<html><body><center><font color=\"LEVEL\">Item Info</font></center><br><table border=0>", "<tr><td>Object ID: </td><td>", String.valueOf(target.getObjectId()), "</td></tr><tr><td>Item ID: </td><td>", String.valueOf(target.getId()), "</td></tr><tr><td>Owner ID: </td><td>", String.valueOf(((L2ItemInstance) target).getOwnerId()), "</td></tr><tr><td>Location: </td><td>", String.valueOf(((L2ItemInstance) target).getLocation()), "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>", target.getClass().getSimpleName(), "</td></tr></table></body></html>"));
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage("<html><body><center><font color=\"LEVEL\">Item Info</font></center><br><table border=0><tr><td>Object ID: </td><td>" + target.getObjectId() + "</td></tr><tr><td>Item ID: </td><td>" + target.getId() + "</td></tr><tr><td>Owner ID: </td><td>" + ((L2ItemInstance) target).getOwnerId() + "</td></tr><tr><td>Location: </td><td>" + ((L2ItemInstance) target).getLocation() + "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>" + target.getClass().getSimpleName() + "</td></tr></table></body></html>");
|
||||
activeChar.sendPacket(html);
|
||||
}
|
||||
return true;
|
||||
|
@ -57,7 +57,7 @@ public class L2NpcActionShift implements IActionShiftHandler
|
||||
public boolean action(L2PcInstance activeChar, L2Object target, boolean interact)
|
||||
{
|
||||
// Check if the L2PcInstance is a GM
|
||||
if (activeChar.getAccessLevel().isGm())
|
||||
if (activeChar.isGM())
|
||||
{
|
||||
// Set the target of the L2PcInstance activeChar
|
||||
activeChar.setTarget(target);
|
||||
|
@ -23,19 +23,18 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.StaticObject;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
public class L2StaticObjectInstanceActionShift implements IActionShiftHandler
|
||||
{
|
||||
@Override
|
||||
public boolean action(L2PcInstance activeChar, L2Object target, boolean interact)
|
||||
{
|
||||
if (activeChar.getAccessLevel().isGm())
|
||||
if (activeChar.isGM())
|
||||
{
|
||||
activeChar.setTarget(target);
|
||||
activeChar.sendPacket(new StaticObject((L2StaticObjectInstance) target));
|
||||
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(StringUtil.concat("<html><body><center><font color=\"LEVEL\">Static Object Info</font></center><br><table border=0><tr><td>Coords X,Y,Z: </td><td>", String.valueOf(target.getX()), ", ", String.valueOf(target.getY()), ", ", String.valueOf(target.getZ()), "</td></tr><tr><td>Object ID: </td><td>", String.valueOf(target.getObjectId()), "</td></tr><tr><td>Static Object ID: </td><td>", String.valueOf(target.getId()), "</td></tr><tr><td>Mesh Index: </td><td>", String.valueOf(((L2StaticObjectInstance) target).getMeshIndex()), "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>", target.getClass().getSimpleName(), "</td></tr></table></body></html>"));
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage("<html><body><center><font color=\"LEVEL\">Static Object Info</font></center><br><table border=0><tr><td>Coords X,Y,Z: </td><td>" + target.getX() + ", " + target.getY() + ", " + target.getZ() + "</td></tr><tr><td>Object ID: </td><td>" + target.getObjectId() + "</td></tr><tr><td>Static Object ID: </td><td>" + target.getId() + "</td></tr><tr><td>Mesh Index: </td><td>" + ((L2StaticObjectInstance) target).getMeshIndex() + "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>" + target.getClass().getSimpleName() + "</td></tr></table></body></html>");
|
||||
activeChar.sendPacket(html);
|
||||
}
|
||||
return true;
|
||||
|
@ -36,7 +36,6 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
|
||||
import com.l2jmobius.gameserver.util.GMAudit;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
public class AdminBuffs implements IAdminCommandHandler
|
||||
{
|
||||
@ -252,9 +251,13 @@ public class AdminBuffs implements IAdminCommandHandler
|
||||
max++;
|
||||
}
|
||||
|
||||
final StringBuilder html = StringUtil.startAppend(500 + (effects.size() * 200), "<html><table width=\"100%\"><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center><font color=\"LEVEL\">Effects of ", target.getName(), "</font></td><td width=45><button value=\"Back\" action=\"bypass -h admin_current_player\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><table width=\"100%\"><tr><td width=200>Skill</td><td width=30>Rem. Time</td><td width=70>Action</td></tr>");
|
||||
final int start = ((page - 1) * PAGE_LIMIT);
|
||||
final int end = Math.min(((page - 1) * PAGE_LIMIT) + PAGE_LIMIT, effects.size());
|
||||
final StringBuilder html = new StringBuilder(500 + (effects.size() * 200));
|
||||
html.append("<html><table width=\"100%\"><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center><font color=\"LEVEL\">Effects of ");
|
||||
html.append(target.getName());
|
||||
html.append("</font></td><td width=45><button value=\"Back\" action=\"bypass -h admin_current_player\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><table width=\"100%\"><tr><td width=200>Skill</td><td width=30>Rem. Time</td><td width=70>Action</td></tr>");
|
||||
|
||||
int start = ((page - 1) * PAGE_LIMIT);
|
||||
int end = Math.min(((page - 1) * PAGE_LIMIT) + PAGE_LIMIT, effects.size());
|
||||
int count = 0;
|
||||
for (BuffInfo info : effects)
|
||||
{
|
||||
@ -263,7 +266,22 @@ public class AdminBuffs implements IAdminCommandHandler
|
||||
final Skill skill = info.getSkill();
|
||||
for (AbstractEffect effect : info.getEffects())
|
||||
{
|
||||
StringUtil.append(html, "<tr><td>", (!info.isInUse() ? FONT_RED1 : "") + skill.getName(), " Lv ", String.valueOf(skill.getLevel()), " (", effect.getClass().getSimpleName(), ")" + (!info.isInUse() ? FONT_RED2 : ""), "</td><td>", skill.isToggle() ? "T (" + info.getTickCount(effect) + ")" : skill.isPassive() ? "P" : info.getTime() + "s", "</td><td><button value=\"X\" action=\"bypass -h admin_stopbuff ", Integer.toString(target.getObjectId()), " ", String.valueOf(skill.getId()), "\" width=30 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
||||
html.append("<tr><td>");
|
||||
html.append(!info.isInUse() ? FONT_RED1 : "");
|
||||
html.append(skill.getName());
|
||||
html.append(" Lv ");
|
||||
html.append(skill.getLevel());
|
||||
html.append(" (");
|
||||
html.append(effect.getClass().getSimpleName());
|
||||
html.append(")");
|
||||
html.append(!info.isInUse() ? FONT_RED2 : "");
|
||||
html.append("</td><td>");
|
||||
html.append(skill.isToggle() ? "T (" + info.getTickCount(effect) + ")" : skill.isPassive() ? "P" : info.getTime() + "s");
|
||||
html.append("</td><td><button value=\"X\" action=\"bypass -h admin_stopbuff ");
|
||||
html.append(target.getObjectId());
|
||||
html.append(" ");
|
||||
html.append(skill.getId());
|
||||
html.append("\" width=30 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
||||
}
|
||||
}
|
||||
count++;
|
||||
@ -294,17 +312,29 @@ public class AdminBuffs implements IAdminCommandHandler
|
||||
html.append("</tr></table>");
|
||||
|
||||
// Buttons
|
||||
StringUtil.append(html, "<br><center><button value=\"Refresh\" action=\"bypass -h admin_getbuffs", (passive ? "_ps " : " "), target.getName(), "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
StringUtil.append(html, "<button value=\"Remove All\" action=\"bypass -h admin_stopallbuffs ", Integer.toString(target.getObjectId()), "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>");
|
||||
html.append("<br><center><button value=\"Refresh\" action=\"bypass -h admin_getbuffs");
|
||||
html.append(passive ? "_ps " : " ");
|
||||
html.append(target.getName());
|
||||
html.append("\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
html.append("<button value=\"Remove All\" action=\"bypass -h admin_stopallbuffs ");
|
||||
html.append(target.getObjectId());
|
||||
html.append("\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>");
|
||||
// Legend
|
||||
if (!passive)
|
||||
{
|
||||
StringUtil.append(html, FONT_RED1, "Inactive buffs: ", String.valueOf(target.getEffectList().getHiddenBuffsCount()), FONT_RED2, "<br>");
|
||||
html.append(FONT_RED1);
|
||||
html.append("Inactive buffs: ");
|
||||
html.append(target.getEffectList().getHiddenBuffsCount());
|
||||
html.append(FONT_RED2);
|
||||
html.append("<br>");
|
||||
}
|
||||
StringUtil.append(html, "Total", passive ? " passive" : "", " buff count: ", String.valueOf(effects.size()));
|
||||
html.append("Total");
|
||||
html.append(passive ? " passive" : "");
|
||||
html.append(" buff count: ");
|
||||
html.append(effects.size());
|
||||
if ((target.getEffectList().getAllBlockedBuffSlots() != null) && !target.getEffectList().getAllBlockedBuffSlots().isEmpty())
|
||||
{
|
||||
StringUtil.append(html, "<br>Blocked buff slots: ");
|
||||
html.append("<br>Blocked buff slots: ");
|
||||
String slots = "";
|
||||
for (AbnormalType slot : target.getEffectList().getAllBlockedBuffSlots())
|
||||
{
|
||||
@ -313,10 +343,10 @@ public class AdminBuffs implements IAdminCommandHandler
|
||||
|
||||
if (!slots.isEmpty() && (slots.length() > 3))
|
||||
{
|
||||
StringUtil.append(html, slots.substring(0, slots.length() - 2));
|
||||
html.append(slots.substring(0, slots.length() - 2));
|
||||
}
|
||||
}
|
||||
StringUtil.append(html, "</html>");
|
||||
html.append("</html>");
|
||||
// Send the packet
|
||||
activeChar.sendPacket(new NpcHtmlMessage(html.toString()));
|
||||
|
||||
|
@ -26,7 +26,6 @@ import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* This class handles following admin commands: - cw_info = displays cursed weapon status - cw_remove = removes a cursed weapon from the world, item id or name must be provided - cw_add = adds a cursed weapon into the world, item id or name must be provided. Target will be the weilder - cw_goto =
|
||||
@ -96,20 +95,51 @@ public class AdminCursedWeapons implements IAdminCommandHandler
|
||||
{
|
||||
itemId = cw.getItemId();
|
||||
|
||||
StringUtil.append(replyMSG, "<table width=270><tr><td>Name:</td><td>", cw.getName(), "</td></tr>");
|
||||
replyMSG.append("<table width=270><tr><td>Name:</td><td>");
|
||||
replyMSG.append(cw.getName());
|
||||
replyMSG.append("</td></tr>");
|
||||
|
||||
if (cw.isActivated())
|
||||
{
|
||||
final L2PcInstance pl = cw.getPlayer();
|
||||
StringUtil.append(replyMSG, "<tr><td>Weilder:</td><td>", (pl == null ? "null" : pl.getName()), "</td></tr><tr><td>Karma:</td><td>", String.valueOf(cw.getPlayerKarma()), "</td></tr><tr><td>Kills:</td><td>", String.valueOf(cw.getPlayerPkKills()), "/", String.valueOf(cw.getNbKills()), "</td></tr><tr><td>Time remaining:</td><td>", String.valueOf(cw.getTimeLeft() / 60000), " min.</td></tr><tr><td><button value=\"Remove\" action=\"bypass -h admin_cw_remove ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Go\" action=\"bypass -h admin_cw_goto ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
||||
L2PcInstance pl = cw.getPlayer();
|
||||
replyMSG.append("<tr><td>Weilder:</td><td>");
|
||||
replyMSG.append(pl == null ? "null" : pl.getName());
|
||||
replyMSG.append("</td></tr>");
|
||||
replyMSG.append("<tr><td>Karma:</td><td>");
|
||||
replyMSG.append(cw.getPlayerKarma());
|
||||
replyMSG.append("</td></tr>");
|
||||
replyMSG.append("<tr><td>Kills:</td><td>");
|
||||
replyMSG.append(cw.getPlayerPkKills());
|
||||
replyMSG.append("/");
|
||||
replyMSG.append(cw.getNbKills());
|
||||
replyMSG.append("</td></tr><tr><td>Time remaining:</td><td>");
|
||||
replyMSG.append(cw.getTimeLeft() / 60000);
|
||||
replyMSG.append(" min.</td></tr>");
|
||||
replyMSG.append("<tr><td><button value=\"Remove\" action=\"bypass -h admin_cw_remove ");
|
||||
replyMSG.append(itemId);
|
||||
replyMSG.append("\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
|
||||
replyMSG.append("<td><button value=\"Go\" action=\"bypass -h admin_cw_goto ");
|
||||
replyMSG.append(itemId);
|
||||
replyMSG.append("\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
||||
}
|
||||
else if (cw.isDropped())
|
||||
{
|
||||
StringUtil.append(replyMSG, "<tr><td>Position:</td><td>Lying on the ground</td></tr><tr><td>Time remaining:</td><td>", String.valueOf(cw.getTimeLeft() / 60000), " min.</td></tr><tr><td>Kills:</td><td>", String.valueOf(cw.getNbKills()), "</td></tr><tr><td><button value=\"Remove\" action=\"bypass -h admin_cw_remove ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Go\" action=\"bypass -h admin_cw_goto ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
||||
replyMSG.append("<tr><td>Position:</td><td>Lying on the ground</td></tr><tr><td>Time remaining:</td><td>");
|
||||
replyMSG.append(cw.getTimeLeft() / 60000);
|
||||
replyMSG.append(" min.</td></tr><tr><td>Kills:</td><td>");
|
||||
replyMSG.append(cw.getNbKills());
|
||||
replyMSG.append("</td></tr><tr><td><button value=\"Remove\" action=\"bypass -h admin_cw_remove ");
|
||||
replyMSG.append(itemId);
|
||||
replyMSG.append("\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
|
||||
replyMSG.append("<td><button value=\"Go\" action=\"bypass -h admin_cw_goto ");
|
||||
replyMSG.append(itemId);
|
||||
replyMSG.append("\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(replyMSG, "<tr><td>Position:</td><td>Doesn't exist.</td></tr><tr><td><button value=\"Give to Target\" action=\"bypass -h admin_cw_add ", String.valueOf(itemId), "\" width=130 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td></td></tr>");
|
||||
replyMSG.append("<tr><td>Position:</td><td>Doesn't exist.</td></tr><tr><td><button value=\"Give to Target\" action=\"bypass -h admin_cw_add ");
|
||||
replyMSG.append(itemId);
|
||||
replyMSG.append("\" width=130 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td></td></tr>");
|
||||
}
|
||||
|
||||
replyMSG.append("</table><br>");
|
||||
|
@ -24,6 +24,7 @@ import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@ -56,7 +57,6 @@ import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
||||
import com.l2jmobius.gameserver.util.HtmlUtil;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* EditChar admin command implementation.
|
||||
@ -1125,7 +1125,15 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
if (name.toLowerCase().contains(CharacterToFind.toLowerCase()))
|
||||
{
|
||||
CharactersFound = CharactersFound + 1;
|
||||
StringUtil.append(replyMSG, "<tr><td width=80><a action=\"bypass -h admin_character_info ", name, "\">", name, "</a></td><td width=110>", ClassListData.getInstance().getClass(player.getClassId()).getClientCode(), "</td><td width=40>", String.valueOf(player.getLevel()), "</td></tr>");
|
||||
replyMSG.append("<tr><td width=80><a action=\"bypass -h admin_character_info ");
|
||||
replyMSG.append(name);
|
||||
replyMSG.append("\">");
|
||||
replyMSG.append(name);
|
||||
replyMSG.append("</a></td><td width=110>");
|
||||
replyMSG.append(ClassListData.getInstance().getClass(player.getClassId()).getClientCode());
|
||||
replyMSG.append("</td><td width=40>");
|
||||
replyMSG.append(player.getLevel());
|
||||
replyMSG.append("</td></tr>");
|
||||
}
|
||||
if (CharactersFound > 20)
|
||||
{
|
||||
@ -1217,7 +1225,15 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
|
||||
name = player.getName();
|
||||
CharactersFound = CharactersFound + 1;
|
||||
StringUtil.append(replyMSG, "<tr><td width=80><a action=\"bypass -h admin_character_info ", name, "\">", name, "</a></td><td width=110>", ClassListData.getInstance().getClass(player.getClassId()).getClientCode(), "</td><td width=40>", String.valueOf(player.getLevel()), "</td></tr>");
|
||||
replyMSG.append("<tr><td width=80><a action=\"bypass -h admin_character_info ");
|
||||
replyMSG.append(name);
|
||||
replyMSG.append("\">");
|
||||
replyMSG.append(name);
|
||||
replyMSG.append("</a></td><td width=110>");
|
||||
replyMSG.append(ClassListData.getInstance().getClass(player.getClassId()).getClientCode());
|
||||
replyMSG.append("</td><td width=40>");
|
||||
replyMSG.append(player.getLevel());
|
||||
replyMSG.append("</td></tr>");
|
||||
|
||||
if (CharactersFound > 20)
|
||||
{
|
||||
@ -1265,8 +1281,8 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
}
|
||||
|
||||
final Map<Integer, String> chars = player.getAccountChars();
|
||||
final StringBuilder replyMSG = new StringBuilder(chars.size() * 20);
|
||||
chars.values().stream().forEachOrdered(name -> StringUtil.append(replyMSG, name, "<br1>"));
|
||||
final StringJoiner replyMSG = new StringJoiner("<br1>");
|
||||
chars.values().stream().forEachOrdered(replyMSG::add);
|
||||
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
adminReply.setFile(activeChar.getHtmlPrefix(), "data/html/admin/accountinfo.htm");
|
||||
@ -1322,7 +1338,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
final StringBuilder results = new StringBuilder();
|
||||
for (String dualboxIP : keys)
|
||||
{
|
||||
StringUtil.append(results, "<a action=\"bypass -h admin_find_ip " + dualboxIP + "\">" + dualboxIP + " (" + dualboxIPs.get(dualboxIP) + ")</a><br1>");
|
||||
results.append("<a action=\"bypass -h admin_find_ip " + dualboxIP + "\">" + dualboxIP + " (" + dualboxIPs.get(dualboxIP) + ")</a><br1>");
|
||||
}
|
||||
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
@ -1374,7 +1390,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
final StringBuilder results = new StringBuilder();
|
||||
for (IpPack dualboxIP : keys)
|
||||
{
|
||||
StringUtil.append(results, "<a action=\"bypass -h admin_find_ip " + dualboxIP.ip + "\">" + dualboxIP.ip + " (" + dualboxIPs.get(dualboxIP) + ")</a><br1>");
|
||||
results.append("<a action=\"bypass -h admin_find_ip " + dualboxIP.ip + "\">" + dualboxIP.ip + " (" + dualboxIPs.get(dualboxIP) + ")</a><br1>");
|
||||
}
|
||||
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
|
@ -41,7 +41,6 @@ import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.util.Rnd;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* This class handles following admin commands: - admin = shows menu
|
||||
@ -227,7 +226,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
||||
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
|
||||
final String replyMSG = StringUtil.concat("<html><title>[ L2J EVENT ENGINE ]</title><body><br>", "<center>The event <font color=\"LEVEL\">", L2Event._eventName, "</font> has been announced, now you can type //event_panel to see the event panel control</center><br>", "</body></html>");
|
||||
final String replyMSG = "<html><title>[ EVENT ENGINE ]</title><body><br><center>The event <font color=\"LEVEL\">" + L2Event._eventName + "</font> has been announced, now you can type //event_panel to see the event panel control</center><br></body></html>";
|
||||
adminReply.setHtml(replyMSG);
|
||||
activeChar.sendPacket(adminReply);
|
||||
}
|
||||
@ -465,7 +464,15 @@ public class AdminEventEngine implements IAdminCommandHandler
|
||||
result.append("<table>");
|
||||
for (String fileName : files)
|
||||
{
|
||||
StringUtil.append(result, "<tr><td align=center>", fileName, " </td></tr><tr><td><table cellspacing=0><tr><td><button value=\"Select Event\" action=\"bypass -h admin_event_set ", fileName, "\" width=90 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"View Event\" action=\"bypass -h admin_event_see ", fileName, "\" width=90 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Delete Event\" action=\"bypass -h admin_event_del ", fileName, "\" width=90 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table></td></tr>", "<tr><td> </td></tr><tr><td> </td></tr>");
|
||||
result.append("<tr><td align=center>");
|
||||
result.append(fileName);
|
||||
result.append(" </td></tr><tr><td><table cellspacing=0><tr><td><button value=\"Select Event\" action=\"bypass -h admin_event_set ");
|
||||
result.append(fileName);
|
||||
result.append("\" width=90 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"View Event\" action=\"bypass -h admin_event_see ");
|
||||
result.append(fileName);
|
||||
result.append("\" width=90 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Delete Event\" action=\"bypass -h admin_event_del ");
|
||||
result.append(fileName);
|
||||
result.append("\" width=90 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table></td></tr><tr><td> </td></tr><tr><td> </td></tr>");
|
||||
}
|
||||
|
||||
result.append("</table>");
|
||||
@ -477,7 +484,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
||||
{
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
|
||||
final String replyMSG = StringUtil.concat("<html><title>[ L2J EVENT ENGINE ]</title><body><br><center><button value=\"Create NEW event \" action=\"bypass -h admin_event_new\" width=150 height=32 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><center><br><font color=LEVEL>Stored Events:</font><br></center>", showStoredEvents(), "</body></html>");
|
||||
final String replyMSG = "<html><title>[ L2J EVENT ENGINE ]</title><body><br><center><button value=\"Create NEW event \" action=\"bypass -h admin_event_new\" width=150 height=32 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><center><br><font color=LEVEL>Stored Events:</font><br></center>" + showStoredEvents() + "</body></html>";
|
||||
adminReply.setHtml(replyMSG);
|
||||
activeChar.sendPacket(adminReply);
|
||||
}
|
||||
@ -486,7 +493,8 @@ public class AdminEventEngine implements IAdminCommandHandler
|
||||
{
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
|
||||
final StringBuilder replyMSG = StringUtil.startAppend(500, "<html><title>[ L2J EVENT ENGINE ]</title><body><br><br><center><font color=LEVEL>Event name:</font><br>");
|
||||
final StringBuilder replyMSG = new StringBuilder(512);
|
||||
replyMSG.append("<html><title>[ L2J EVENT ENGINE ]</title><body><br><br><center><font color=LEVEL>Event name:</font><br>");
|
||||
|
||||
if (tempName.isEmpty())
|
||||
{
|
||||
|
@ -24,7 +24,6 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.quest.Event;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
public class AdminEvents implements IAdminCommandHandler
|
||||
{
|
||||
@ -156,7 +155,7 @@ public class AdminEvents implements IAdminCommandHandler
|
||||
{
|
||||
if (event instanceof Event)
|
||||
{
|
||||
StringUtil.append(cList, "<font color=\"LEVEL\">" + event.getName() + ":</font><br1>", "<table width=270><tr>", "<td><button value=\"Start\" action=\"bypass -h admin_event_start_menu " + event.getName() + "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>", "<td><button value=\"Stop\" action=\"bypass -h admin_event_stop_menu " + event.getName() + "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>", "<td><button value=\"Menu\" action=\"bypass -h admin_event_bypass " + event.getName() + "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>", "</tr></table><br>");
|
||||
cList.append("<font color=\"LEVEL\">" + event.getName() + ":</font><br1><table width=270><tr><td><button value=\"Start\" action=\"bypass -h admin_event_start_menu " + event.getName() + "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Stop\" action=\"bypass -h admin_event_stop_menu " + event.getName() + "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
|
||||
}
|
||||
}
|
||||
html.replace("%LIST%", cList.toString());
|
||||
|
@ -28,7 +28,6 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* This class handles following admin commands: - gm = turns gm mode on/off
|
||||
@ -123,16 +122,17 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
if ((npc1 != null) && (npc2 != null))
|
||||
{
|
||||
replyMSG = StringUtil.concat("<html><title>Selected mobs to fight</title><body><table><tr><td>First</td><td>Second</td></tr><tr><td>level ", String.valueOf(lvl1), "</td><td>level ", String.valueOf(lvl2), "</td></tr><tr><td>id ", String.valueOf(npc1.getId()), "</td><td>id ", String.valueOf(npc2.getId()), "</td></tr><tr><td>", npc1.getName(), "</td><td>", npc2.getName(), "</td></tr></table><center><br><br><br><button value=\"OK\" action=\"bypass -h admin_fight_calculator_show ", String.valueOf(npc1.getId()), " ", String.valueOf(npc2.getId()), "\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
|
||||
replyMSG = "<html><title>Selected mobs to fight</title><body><table><tr><td>First</td><td>Second</td></tr><tr><td>level " + lvl1 + "</td><td>level " + lvl2 + "</td></tr><tr><td>id " + npc1.getId() + "</td><td>id " + npc2.getId() + "</td></tr><tr><td>" + npc1.getName() + "</td><td>" + npc2.getName() + "</td></tr></table><center><br><br><br><button value=\"OK\" action=\"bypass -h admin_fight_calculator_show " + npc1.getId() + " " + npc2.getId() + "\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center></body></html>";
|
||||
}
|
||||
else if ((lvl1 != 0) && (npc1 == null))
|
||||
{
|
||||
final List<L2NpcTemplate> npcs = NpcData.getInstance().getAllOfLevel(lvl1);
|
||||
final StringBuilder sb = StringUtil.startAppend(50 + (npcs.size() * 200), "<html><title>Select first mob to fight</title><body><table>");
|
||||
final StringBuilder sb = new StringBuilder(50 + (npcs.size() * 200));
|
||||
sb.append("<html><title>Select first mob to fight</title><body><table>");
|
||||
|
||||
for (L2NpcTemplate n : npcs)
|
||||
{
|
||||
StringUtil.append(sb, "<tr><td><a action=\"bypass -h admin_fight_calculator lvl1 ", String.valueOf(lvl1), " lvl2 ", String.valueOf(lvl2), " mid1 ", String.valueOf(n.getId()), " mid2 ", String.valueOf(mid2), "\">", n.getName(), "</a></td></tr>");
|
||||
sb.append("<tr><td><a action=\"bypass -h admin_fight_calculator lvl1 " + lvl1 + " lvl2 " + lvl2 + " mid1 " + n.getId() + " mid2 " + mid2 + "\">" + n.getName() + "</a></td></tr>");
|
||||
}
|
||||
|
||||
sb.append("</table></body></html>");
|
||||
@ -141,11 +141,12 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
else if ((lvl2 != 0) && (npc2 == null))
|
||||
{
|
||||
final List<L2NpcTemplate> npcs = NpcData.getInstance().getAllOfLevel(lvl2);
|
||||
final StringBuilder sb = StringUtil.startAppend(50 + (npcs.size() * 200), "<html><title>Select second mob to fight</title><body><table>");
|
||||
final StringBuilder sb = new StringBuilder(50 + (npcs.size() * 200));
|
||||
sb.append("<html><title>Select second mob to fight</title><body><table>");
|
||||
|
||||
for (L2NpcTemplate n : npcs)
|
||||
{
|
||||
StringUtil.append(sb, "<tr><td><a action=\"bypass -h admin_fight_calculator lvl1 ", String.valueOf(lvl1), " lvl2 ", String.valueOf(lvl2), " mid1 ", String.valueOf(mid1), " mid2 ", String.valueOf(n.getId()), "\">", n.getName(), "</a></td></tr>");
|
||||
sb.append("<tr><td><a action=\"bypass -h admin_fight_calculator lvl1 " + lvl1 + " lvl2 " + lvl2 + " mid1 " + mid1 + " mid2 " + n.getId() + "\">" + n.getName() + "</a></td></tr>");
|
||||
}
|
||||
|
||||
sb.append("</table></body></html>");
|
||||
@ -299,7 +300,8 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
|
||||
final StringBuilder replyMSG = StringUtil.startAppend(1000, "<html><title>Selected mobs to fight</title><body><table>");
|
||||
final StringBuilder replyMSG = new StringBuilder(1000);
|
||||
replyMSG.append("<html><title>Selected mobs to fight</title><body><table>");
|
||||
|
||||
if (params.length() == 0)
|
||||
{
|
||||
@ -307,14 +309,14 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(replyMSG, "<tr><td width=140>Parameter</td><td width=70>", ((L2NpcTemplate) npc1.getTemplate()).getName(), "</td><td width=70>", ((L2NpcTemplate) npc2.getTemplate()).getName(), "</td></tr>");
|
||||
replyMSG.append("<tr><td width=140>Parameter</td><td width=70>" + ((L2NpcTemplate) npc1.getTemplate()).getName() + "</td><td width=70>" + ((L2NpcTemplate) npc2.getTemplate()).getName() + "</td></tr>");
|
||||
}
|
||||
|
||||
StringUtil.append(replyMSG, "<tr><td>miss</td><td>", String.valueOf(miss1), "%</td><td>", String.valueOf(miss2), "%</td></tr><tr><td>shld</td><td>", String.valueOf(shld2), "%</td><td>", String.valueOf(shld1), "%</td></tr><tr><td>crit</td><td>", String.valueOf(crit1), "%</td><td>", String.valueOf(crit2), "%</td></tr><tr><td>pAtk / pDef</td><td>", String.valueOf((int) patk1), " / ", String.valueOf((int) pdef1), "</td><td>", String.valueOf((int) patk2), " / ", String.valueOf((int) pdef2), "</td></tr><tr><td>made hits</td><td>", String.valueOf(sAtk1), "</td><td>", String.valueOf(sAtk2), "</td></tr><tr><td>dmg per hit</td><td>", String.valueOf((int) dmg1), "</td><td>", String.valueOf((int) dmg2), "</td></tr><tr><td>got dmg</td><td>", String.valueOf(tdmg2), "</td><td>", String.valueOf(tdmg1), "</td></tr><tr><td>got regen</td><td>", String.valueOf(hp1), "</td><td>", String.valueOf(hp2), "</td></tr><tr><td>had HP</td><td>", String.valueOf((int) maxHp1), "</td><td>", String.valueOf((int) maxHp2), "</td></tr><tr><td>die</td>");
|
||||
replyMSG.append("<tr><td>miss</td><td>" + miss1 + "%</td><td>" + miss2 + "%</td></tr><tr><td>shld</td><td>" + shld2 + "%</td><td>" + shld1 + "%</td></tr><tr><td>crit</td><td>" + crit1 + "%</td><td>" + crit2 + "%</td></tr><tr><td>pAtk / pDef</td><td>" + (int) patk1 + " / " + (int) pdef1 + "</td><td>" + (int) patk2 + " / " + (int) pdef2 + "</td></tr><tr><td>made hits</td><td>" + sAtk1 + "</td><td>" + sAtk2 + "</td></tr><tr><td>dmg per hit</td><td>" + (int) dmg1 + "</td><td>" + (int) dmg2 + "</td></tr><tr><td>got dmg</td><td>" + tdmg2 + "</td><td>" + tdmg1 + "</td></tr><tr><td>got regen</td><td>" + hp1 + "</td><td>" + hp2 + "</td></tr><tr><td>had HP</td><td>" + (int) maxHp1 + "</td><td>" + (int) maxHp2 + "</td></tr><tr><td>die</td>");
|
||||
|
||||
if ((tdmg2 - hp1) > 1)
|
||||
{
|
||||
StringUtil.append(replyMSG, "<td>", String.valueOf((int) ((100 * maxHp1) / (tdmg2 - hp1))), " sec</td>");
|
||||
replyMSG.append("<td>" + ((int) ((100 * maxHp1) / (tdmg2 - hp1))) + " sec</td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -323,7 +325,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
if ((tdmg1 - hp2) > 1)
|
||||
{
|
||||
StringUtil.append(replyMSG, "<td>", String.valueOf((int) ((100 * maxHp2) / (tdmg1 - hp2))), " sec</td>");
|
||||
replyMSG.append("<td>" + ((int) ((100 * maxHp2) / (tdmg1 - hp2))) + " sec</td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -338,7 +340,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(replyMSG, "<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show ", String.valueOf(((L2NpcTemplate) npc1.getTemplate()).getId()), " ", String.valueOf(((L2NpcTemplate) npc2.getTemplate()).getId()), "\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
replyMSG.append("<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show " + ((L2NpcTemplate) npc1.getTemplate()).getId() + " " + ((L2NpcTemplate) npc2.getTemplate()).getId() + "\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
|
||||
replyMSG.append("</center></body></html>");
|
||||
|
@ -28,7 +28,6 @@ import com.l2jmobius.gameserver.model.entity.Fort;
|
||||
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;
|
||||
|
||||
/**
|
||||
* This class handles all siege commands: Todo: change the class name, and neaten it up
|
||||
@ -161,7 +160,7 @@ public class AdminFortSiege implements IAdminCommandHandler
|
||||
{
|
||||
if (fort != null)
|
||||
{
|
||||
StringUtil.append(cList, "<td fixwidth=90><a action=\"bypass -h admin_fortsiege ", String.valueOf(fort.getResidenceId()), "\">", fort.getName(), " id: ", String.valueOf(fort.getResidenceId()), "</a></td>");
|
||||
cList.append("<td fixwidth=90><a action=\"bypass -h admin_fortsiege " + fort.getResidenceId() + "\">" + fort.getName() + " id: " + fort.getResidenceId() + "</a></td>");
|
||||
i++;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,6 @@ import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.gameserver.util.GMAudit;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
public class AdminInstanceZone implements IAdminCommandHandler
|
||||
{
|
||||
@ -118,7 +117,8 @@ public class AdminInstanceZone implements IAdminCommandHandler
|
||||
{
|
||||
final Map<Integer, Long> instanceTimes = InstanceManager.getInstance().getAllInstanceTimes(player.getObjectId());
|
||||
|
||||
final StringBuilder html = StringUtil.startAppend(500 + (instanceTimes.size() * 200), "<html><center><table width=260><tr><td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Character Instances</center></td><td width=40><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><font color=\"LEVEL\">Instances for ", player.getName(), "</font><center><br><table><tr><td width=150>Name</td><td width=50>Time</td><td width=70>Action</td></tr>");
|
||||
final StringBuilder html = new StringBuilder(500 + (instanceTimes.size() * 200));
|
||||
html.append("<html><center><table width=260><tr><td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Character Instances</center></td><td width=40><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><font color=\"LEVEL\">Instances for " + player.getName() + "</font><center><br><table><tr><td width=150>Name</td><td width=50>Time</td><td width=70>Action</td></tr>");
|
||||
|
||||
for (int id : instanceTimes.keySet())
|
||||
{
|
||||
@ -131,10 +131,10 @@ public class AdminInstanceZone implements IAdminCommandHandler
|
||||
minutes = (int) ((remainingTime % 3600) / 60);
|
||||
}
|
||||
|
||||
StringUtil.append(html, "<tr><td>", InstanceManager.getInstance().getInstanceIdName(id), "</td><td>", String.valueOf(hours), ":", String.valueOf(minutes), "</td><td><button value=\"Clear\" action=\"bypass -h admin_instancezone_clear ", player.getName(), " ", String.valueOf(id), "\" width=60 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
||||
html.append("<tr><td>" + InstanceManager.getInstance().getInstanceIdName(id) + "</td><td>" + hours + ":" + minutes + "</td><td><button value=\"Clear\" action=\"bypass -h admin_instancezone_clear " + player.getName() + " " + id + "\" width=60 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
||||
}
|
||||
|
||||
StringUtil.append(html, "</table></html>");
|
||||
html.append("</table></html>");
|
||||
|
||||
final NpcHtmlMessage ms = new NpcHtmlMessage();
|
||||
ms.setHtml(html.toString());
|
||||
|
@ -23,7 +23,6 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.entity.Castle;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* @author malyelfik
|
||||
@ -42,10 +41,10 @@ public final class AdminManor implements IAdminCommandHandler
|
||||
final StringBuilder sb = new StringBuilder(3400);
|
||||
for (Castle c : CastleManager.getInstance().getCastles())
|
||||
{
|
||||
StringUtil.append(sb, "<tr><td>Name:</td><td><font color=008000>" + c.getName() + "</font></td></tr>");
|
||||
StringUtil.append(sb, "<tr><td>Current period cost:</td><td><font color=FF9900>", Util.formatAdena(manor.getManorCost(c.getResidenceId(), false)), " Adena</font></td></tr>");
|
||||
StringUtil.append(sb, "<tr><td>Next period cost:</td><td><font color=FF9900>", Util.formatAdena(manor.getManorCost(c.getResidenceId(), true)), " Adena</font></td></tr>");
|
||||
StringUtil.append(sb, "<tr><td><font color=808080>--------------------------</font></td><td><font color=808080>--------------------------</font></td></tr>");
|
||||
sb.append("<tr><td>Name:</td><td><font color=008000>" + c.getName() + "</font></td></tr>");
|
||||
sb.append("<tr><td>Current period cost:</td><td><font color=FF9900>" + Util.formatAdena(manor.getManorCost(c.getResidenceId(), false)) + " Adena</font></td></tr>");
|
||||
sb.append("<tr><td>Next period cost:</td><td><font color=FF9900>" + Util.formatAdena(manor.getManorCost(c.getResidenceId(), true)) + " Adena</font></td></tr>");
|
||||
sb.append("<tr><td><font color=808080>--------------------------</font></td><td><font color=808080>--------------------------</font></td></tr>");
|
||||
}
|
||||
msg.replace("%castleInfo%", sb.toString());
|
||||
activeChar.sendPacket(msg);
|
||||
|
@ -35,7 +35,6 @@ import com.l2jmobius.gameserver.model.zone.type.L2ClanHallZone;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* This class handles all siege commands.
|
||||
@ -350,7 +349,7 @@ public class AdminSiege implements IAdminCommandHandler
|
||||
if (castle != null)
|
||||
{
|
||||
final String name = castle.getName();
|
||||
StringUtil.append(cList, "<td fixwidth=90><a action=\"bypass -h admin_siege ", name, "\">", name, "</a></td>");
|
||||
cList.append("<td fixwidth=90><a action=\"bypass -h admin_siege " + name + "\">" + name + "</a></td>");
|
||||
i++;
|
||||
}
|
||||
if (i > 2)
|
||||
@ -366,7 +365,7 @@ public class AdminSiege implements IAdminCommandHandler
|
||||
{
|
||||
if (hall != null)
|
||||
{
|
||||
StringUtil.append(cList, "<td fixwidth=90><a action=\"bypass -h admin_chsiege_siegablehall ", String.valueOf(hall.getId()), "\">", hall.getName(), "</a></td>");
|
||||
cList.append("<td fixwidth=90><a action=\"bypass -h admin_chsiege_siegablehall " + String.valueOf(hall.getId()) + "\">" + hall.getName() + "</a></td>");
|
||||
i++;
|
||||
}
|
||||
if (i > 1)
|
||||
@ -382,7 +381,7 @@ public class AdminSiege implements IAdminCommandHandler
|
||||
{
|
||||
if (clanhall != null)
|
||||
{
|
||||
StringUtil.append(cList, "<td fixwidth=134><a action=\"bypass -h admin_clanhall ", String.valueOf(clanhall.getId()), "\">", clanhall.getName(), "</a></td>");
|
||||
cList.append("<td fixwidth=134><a action=\"bypass -h admin_clanhall " + String.valueOf(clanhall.getId()) + "\">" + clanhall.getName() + "</a></td>");
|
||||
i++;
|
||||
}
|
||||
if (i > 1)
|
||||
@ -398,7 +397,7 @@ public class AdminSiege implements IAdminCommandHandler
|
||||
{
|
||||
if (clanhall != null)
|
||||
{
|
||||
StringUtil.append(cList, "<td fixwidth=134><a action=\"bypass -h admin_clanhall ", String.valueOf(clanhall.getId()), "\">", clanhall.getName(), "</a></td>");
|
||||
cList.append("<td fixwidth=134><a action=\"bypass -h admin_clanhall " + String.valueOf(clanhall.getId()) + "\">" + clanhall.getName() + "</a></td>");
|
||||
i++;
|
||||
}
|
||||
if (i > 1)
|
||||
|
@ -35,7 +35,6 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* This class handles following admin commands:
|
||||
@ -311,19 +310,20 @@ public class AdminSkill implements IAdminCommandHandler
|
||||
}
|
||||
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
final StringBuilder replyMSG = StringUtil.startAppend(500 + (maxPages * 50) + (((skillsEnd - skillsStart) + 1) * 50), "<html><body><table width=260><tr><td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Character Selection Menu</center></td><td width=40><button value=\"Back\" action=\"bypass -h admin_show_skills\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><br><center>Editing <font color=\"LEVEL\">", player.getName(), "</font></center><br><table width=270><tr><td>Lv: ", String.valueOf(player.getLevel()), " ", ClassListData.getInstance().getClass(player.getClassId()).getClientCode(), "</td></tr></table><br><table width=270><tr><td>Note: Dont forget that modifying players skills can</td></tr><tr><td>ruin the game...</td></tr></table><br><center>Click on the skill you wish to remove:</center><br><center><table width=270><tr>");
|
||||
final StringBuilder replyMSG = new StringBuilder(500 + (maxPages * 50) + (((skillsEnd - skillsStart) + 1) * 50));
|
||||
replyMSG.append("<html><body><table width=260><tr><td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Character Selection Menu</center></td><td width=40><button value=\"Back\" action=\"bypass -h admin_show_skills\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><br><center>Editing <font color=\"LEVEL\">" + player.getName() + "</font></center><br><table width=270><tr><td>Lv: " + player.getLevel() + " " + ClassListData.getInstance().getClass(player.getClassId()).getClientCode() + "</td></tr></table><br><table width=270><tr><td>Note: Dont forget that modifying players skills can</td></tr><tr><td>ruin the game...</td></tr></table><br><center>Click on the skill you wish to remove:</center><br><center><table width=270><tr>");
|
||||
|
||||
for (int x = 0; x < maxPages; x++)
|
||||
{
|
||||
final int pagenr = x + 1;
|
||||
StringUtil.append(replyMSG, "<td><a action=\"bypass -h admin_remove_skills ", String.valueOf(x), "\">Page ", String.valueOf(pagenr), "</a></td>");
|
||||
replyMSG.append("<td><a action=\"bypass -h admin_remove_skills " + x + "\">Page " + pagenr + "</a></td>");
|
||||
}
|
||||
|
||||
replyMSG.append("</tr></table></center><br><table width=270><tr><td width=80>Name:</td><td width=60>Level:</td><td width=40>Id:</td></tr>");
|
||||
|
||||
for (int i = skillsStart; i < skillsEnd; i++)
|
||||
{
|
||||
StringUtil.append(replyMSG, "<tr><td width=80><a action=\"bypass -h admin_remove_skill ", String.valueOf(skills[i].getId()), "\">", skills[i].getName(), "</a></td><td width=60>", String.valueOf(skills[i].getLevel()), "</td><td width=40>", String.valueOf(skills[i].getId()), "</td></tr>");
|
||||
replyMSG.append("<tr><td width=80><a action=\"bypass -h admin_remove_skill " + skills[i].getId() + "\">" + skills[i].getName() + "</a></td><td width=60>" + skills[i].getLevel() + "</td><td width=40>" + skills[i].getId() + "</td></tr>");
|
||||
}
|
||||
|
||||
replyMSG.append("</table><br><center><table>Remove skill by ID :<tr><td>Id: </td><td><edit var=\"id_to_remove\" width=110></td></tr></table></center><center><button value=\"Remove skill\" action=\"bypass -h admin_remove_skill $id_to_remove\" width=110 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center><br><center><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
|
||||
|
@ -45,7 +45,6 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* This class handles following admin commands: - show_spawns = shows menu - spawn_index lvl = shows menu for monsters with respective level - spawn_monster id = spawns monster id on target
|
||||
@ -170,7 +169,8 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
final int instance = Integer.parseInt(st.nextToken());
|
||||
if (instance >= 300000)
|
||||
{
|
||||
final StringBuilder html = StringUtil.startAppend(500 + 1000, "<html><table width=\"100%\"><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>", "<font color=\"LEVEL\">Spawns for " + String.valueOf(instance) + "</font>", "</td><td width=45><button value=\"Back\" action=\"bypass -h admin_current_player\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br>", "<table width=\"100%\"><tr><td width=200>NpcName</td><td width=70>Action</td></tr>");
|
||||
final StringBuilder html = new StringBuilder(1500);
|
||||
html.append("<html><table width=\"100%\"><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center><font color=\"LEVEL\">Spawns for " + instance + "</font></td><td width=45><button value=\"Back\" action=\"bypass -h admin_current_player\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><table width=\"100%\"><tr><td width=200>NpcName</td><td width=70>Action</td></tr>");
|
||||
int counter = 0;
|
||||
int skiped = 0;
|
||||
final Instance inst = InstanceManager.getInstance().getInstance(instance);
|
||||
@ -183,7 +183,7 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
// Only 50 because of client html limitation
|
||||
if (counter < 50)
|
||||
{
|
||||
StringUtil.append(html, "<tr><td>" + npc.getName() + "</td><td>", "<a action=\"bypass -h admin_move_to " + npc.getX() + " " + npc.getY() + " " + npc.getZ() + "\">Go</a>", "</td></tr>");
|
||||
html.append("<tr><td>" + npc.getName() + "</td><td><a action=\"bypass -h admin_move_to " + npc.getX() + " " + npc.getY() + " " + npc.getZ() + "\">Go</a></td></tr>");
|
||||
counter++;
|
||||
}
|
||||
else
|
||||
@ -192,7 +192,7 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
StringUtil.append(html, "<tr><td>Skipped:</td><td>" + String.valueOf(skiped) + "</td></tr></table></body></html>");
|
||||
html.append("<tr><td>Skipped:</td><td>" + skiped + "</td></tr></table></body></html>");
|
||||
final NpcHtmlMessage ms = new NpcHtmlMessage();
|
||||
ms.setHtml(html.toString());
|
||||
activeChar.sendPacket(ms);
|
||||
@ -465,13 +465,14 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
{
|
||||
final List<L2NpcTemplate> mobs = NpcData.getInstance().getAllMonstersOfLevel(level);
|
||||
final int mobsCount = mobs.size();
|
||||
final StringBuilder tb = StringUtil.startAppend(500 + (mobsCount * 80), "<html><title>Spawn Monster:</title><body><p> Level : ", Integer.toString(level), "<br>Total Npc's : ", Integer.toString(mobsCount), "<br>");
|
||||
final StringBuilder tb = new StringBuilder(500 + (mobsCount * 80));
|
||||
tb.append("<html><title>Spawn Monster:</title><body><p> Level : " + level + "<br>Total Npc's : " + mobsCount + "<br>");
|
||||
|
||||
// Loop
|
||||
int i = from;
|
||||
for (int j = 0; (i < mobsCount) && (j < 50); i++, j++)
|
||||
{
|
||||
StringUtil.append(tb, "<a action=\"bypass -h admin_spawn_monster ", Integer.toString(mobs.get(i).getId()), "\">", mobs.get(i).getName(), "</a><br1>");
|
||||
tb.append("<a action=\"bypass -h admin_spawn_monster " + mobs.get(i).getId() + "\">" + mobs.get(i).getName() + "</a><br1>");
|
||||
}
|
||||
|
||||
if (i == mobsCount)
|
||||
@ -480,7 +481,7 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(tb, "<br><center><button value=\"Next\" action=\"bypass -h admin_spawn_index ", Integer.toString(level), " ", Integer.toString(i), "\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><button value=\"Back\" action=\"bypass -h admin_show_spawns\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
|
||||
tb.append("<br><center><button value=\"Next\" action=\"bypass -h admin_spawn_index " + level + " " + i + "\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><button value=\"Back\" action=\"bypass -h admin_show_spawns\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
|
||||
}
|
||||
|
||||
activeChar.sendPacket(new NpcHtmlMessage(tb.toString()));
|
||||
@ -490,13 +491,14 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
{
|
||||
final List<L2NpcTemplate> mobs = NpcData.getInstance().getAllNpcStartingWith(starting);
|
||||
final int mobsCount = mobs.size();
|
||||
final StringBuilder tb = StringUtil.startAppend(500 + (mobsCount * 80), "<html><title>Spawn Monster:</title><body><p> There are ", Integer.toString(mobsCount), " Npcs whose name starts with ", starting, ":<br>");
|
||||
final StringBuilder tb = new StringBuilder(500 + (mobsCount * 80));
|
||||
tb.append("<html><title>Spawn Monster:</title><body><p> There are " + mobsCount + " Npcs whose name starts with " + starting + ":<br>");
|
||||
|
||||
// Loop
|
||||
int i = from;
|
||||
for (int j = 0; (i < mobsCount) && (j < 50); i++, j++)
|
||||
{
|
||||
StringUtil.append(tb, "<a action=\"bypass -h admin_spawn_monster ", Integer.toString(mobs.get(i).getId()), "\">", mobs.get(i).getName(), "</a><br1>");
|
||||
tb.append("<a action=\"bypass -h admin_spawn_monster " + mobs.get(i).getId() + "\">" + mobs.get(i).getName() + "</a><br1>");
|
||||
}
|
||||
|
||||
if (i == mobsCount)
|
||||
@ -505,7 +507,7 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(tb, "<br><center><button value=\"Next\" action=\"bypass -h admin_npc_index ", starting, " ", Integer.toString(i), "\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><button value=\"Back\" action=\"bypass -h admin_show_npcs\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
|
||||
tb.append("<br><center><button value=\"Next\" action=\"bypass -h admin_npc_index " + starting + " " + i + "\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><button value=\"Back\" action=\"bypass -h admin_show_npcs\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
|
||||
}
|
||||
|
||||
activeChar.sendPacket(new NpcHtmlMessage(tb.toString()));
|
||||
|
@ -40,7 +40,6 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2RaidBossInstance;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* This class handles following admin commands: - show_moves - show_teleport - teleport_to_character - move_to - teleport_character
|
||||
@ -372,7 +371,7 @@ public class AdminTeleport implements IAdminCommandHandler
|
||||
}
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
|
||||
final String replyMSG = StringUtil.concat("<html><title>Teleport Character</title><body>The character you will teleport is ", player.getName(), ".<br>Co-ordinate x<edit var=\"char_cord_x\" width=110>Co-ordinate y<edit var=\"char_cord_y\" width=110>Co-ordinate z<edit var=\"char_cord_z\" width=110><button value=\"Teleport\" action=\"bypass -h admin_teleport_character $char_cord_x $char_cord_y $char_cord_z\" width=60 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><button value=\"Teleport near you\" action=\"bypass -h admin_teleport_character ", String.valueOf(activeChar.getX()), " ", String.valueOf(activeChar.getY()), " ", String.valueOf(activeChar.getZ()), "\" width=115 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><center><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
|
||||
final String replyMSG = "<html><title>Teleport Character</title><body>The character you will teleport is " + player.getName() + ".<br>Co-ordinate x<edit var=\"char_cord_x\" width=110>Co-ordinate y<edit var=\"char_cord_y\" width=110>Co-ordinate z<edit var=\"char_cord_z\" width=110><button value=\"Teleport\" action=\"bypass -h admin_teleport_character $char_cord_x $char_cord_y $char_cord_z\" width=60 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><button value=\"Teleport near you\" action=\"bypass -h admin_teleport_character " + activeChar.getX() + " " + activeChar.getY() + " " + activeChar.getZ() + "\" width=115 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><center><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center></body></html>";
|
||||
adminReply.setHtml(replyMSG);
|
||||
activeChar.sendPacket(adminReply);
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ import com.l2jmobius.gameserver.model.zone.L2ZoneType;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import com.l2jmobius.gameserver.model.zone.type.NpcSpawnTerritory;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* Small typo fix by Zoey76 24/02/2011
|
||||
@ -138,22 +137,26 @@ public class AdminZone implements IAdminCommandHandler
|
||||
{
|
||||
if (zone.getName() != null)
|
||||
{
|
||||
StringUtil.append(zones, zone.getName() + "<br1>");
|
||||
zones.append(zone.getName());
|
||||
zones.append("<br1>");
|
||||
if (zone.getId() < 300000)
|
||||
{
|
||||
StringUtil.append(zones, "(", String.valueOf(zone.getId()), ")");
|
||||
zones.append("(");
|
||||
zones.append(zone.getId());
|
||||
zones.append(")");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(zones, String.valueOf(zone.getId()));
|
||||
zones.append(zone.getId());
|
||||
}
|
||||
StringUtil.append(zones, " ");
|
||||
zones.append(" ");
|
||||
}
|
||||
}
|
||||
for (NpcSpawnTerritory territory : ZoneManager.getInstance().getSpawnTerritories(activeChar))
|
||||
{
|
||||
StringUtil.append(zones, territory.getName() + "<br1>");
|
||||
zones.append(territory.getName());
|
||||
zones.append("<br1>");
|
||||
}
|
||||
adminReply.replace("%ZLIST%", zones.toString());
|
||||
activeChar.sendPacket(adminReply);
|
||||
|
@ -34,7 +34,6 @@ import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
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;
|
||||
|
||||
public class Festival implements IBypassHandler
|
||||
{
|
||||
@ -208,8 +207,8 @@ public class Festival implements IBypassHandler
|
||||
}
|
||||
break;
|
||||
case 4: // Current High Scores
|
||||
final StringBuilder strBuffer = StringUtil.startAppend(500, "<html><body>Festival Guide:<br>These are the top scores of the week, for the ");
|
||||
|
||||
final StringBuilder strBuffer = new StringBuilder(500);
|
||||
strBuffer.append("<html><body>Festival Guide:<br>These are the top scores of the week, for the ");
|
||||
final StatsSet dawnData = SevenSignsFestival.getInstance().getHighestScoreData(SevenSigns.CABAL_DAWN, npc.getFestivalType());
|
||||
final StatsSet duskData = SevenSignsFestival.getInstance().getHighestScoreData(SevenSigns.CABAL_DUSK, npc.getFestivalType());
|
||||
final StatsSet overallData = SevenSignsFestival.getInstance().getOverallHighestScoreData(npc.getFestivalType());
|
||||
@ -224,11 +223,11 @@ public class Festival implements IBypassHandler
|
||||
overallScore = overallData.getInt("score");
|
||||
}
|
||||
|
||||
StringUtil.append(strBuffer, SevenSignsFestival.getFestivalName(npc.getFestivalType()), " festival.<br>");
|
||||
strBuffer.append(SevenSignsFestival.getFestivalName(npc.getFestivalType()) + " festival.<br>");
|
||||
|
||||
if (dawnScore > 0)
|
||||
{
|
||||
StringUtil.append(strBuffer, "Dawn: ", calculateDate(dawnData.getString("date")), ". Score ", String.valueOf(dawnScore), "<br>", dawnData.getString("members"), "<br>");
|
||||
strBuffer.append("Dawn: " + calculateDate(dawnData.getString("date")) + ". Score " + String.valueOf(dawnScore) + "<br>" + dawnData.getString("members") + "<br>");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -237,7 +236,7 @@ public class Festival implements IBypassHandler
|
||||
|
||||
if (duskScore > 0)
|
||||
{
|
||||
StringUtil.append(strBuffer, "Dusk: ", calculateDate(duskData.getString("date")), ". Score ", String.valueOf(duskScore), "<br>", duskData.getString("members"), "<br>");
|
||||
strBuffer.append("Dusk: " + calculateDate(duskData.getString("date")) + ". Score " + String.valueOf(duskScore) + "<br>" + duskData.getString("members") + "<br>");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -256,14 +255,14 @@ public class Festival implements IBypassHandler
|
||||
cabalStr = "Children of Dusk";
|
||||
}
|
||||
|
||||
StringUtil.append(strBuffer, "Consecutive top scores: ", calculateDate(overallData.getString("date")), ". Score ", String.valueOf(overallScore), "<br>Affilated side: ", cabalStr, "<br>", overallData.getString("members"), "<br>");
|
||||
strBuffer.append("Consecutive top scores: " + calculateDate(overallData.getString("date")) + ". Score " + String.valueOf(overallScore) + "<br>Affilated side: " + cabalStr + "<br>" + overallData.getString("members") + "<br>");
|
||||
}
|
||||
else
|
||||
{
|
||||
strBuffer.append("Consecutive top scores: No record exists. Score 0<br>");
|
||||
}
|
||||
|
||||
StringUtil.append(strBuffer, "<a action=\"bypass -h npc_", String.valueOf(npc.getObjectId()), "_Chat 0\">Go back.</a></body></html>");
|
||||
strBuffer.append("<a action=\"bypass -h npc_" + String.valueOf(npc.getObjectId()) + "_Chat 0\">Go back.</a></body></html>");
|
||||
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
||||
html.setHtml(strBuffer.toString());
|
||||
|
@ -37,7 +37,6 @@ import com.l2jmobius.gameserver.model.quest.QuestState;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
public class QuestLink implements IBypassHandler
|
||||
{
|
||||
@ -88,7 +87,8 @@ public class QuestLink implements IBypassHandler
|
||||
*/
|
||||
private static void showQuestChooseWindow(L2PcInstance player, L2Npc npc, Quest[] quests)
|
||||
{
|
||||
final StringBuilder sb = StringUtil.startAppend(150, "<html><body>");
|
||||
final StringBuilder sb = new StringBuilder(128);
|
||||
sb.append("<html><body>");
|
||||
String state = "";
|
||||
// String color = "";
|
||||
int questId = -1;
|
||||
@ -122,17 +122,17 @@ public class QuestLink implements IBypassHandler
|
||||
state = quest.isCustomQuest() ? " (Done)" : "03";
|
||||
// color = "787878";
|
||||
}
|
||||
StringUtil.append(sb, "<a action=\"bypass -h npc_", String.valueOf(npc.getObjectId()), "_Quest ", quest.getName(), "\">");
|
||||
sb.append("<a action=\"bypass -h npc_" + String.valueOf(npc.getObjectId()) + "_Quest " + quest.getName() + "\">");
|
||||
// StringUtil.append(sb, "<font color=\"" + color + "\">[");
|
||||
StringUtil.append(sb, "[");
|
||||
sb.append("[");
|
||||
|
||||
if (quest.isCustomQuest())
|
||||
{
|
||||
StringUtil.append(sb, quest.getDescr(), state);
|
||||
sb.append(quest.getDescr() + state);
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(sb, "<fstring>", String.valueOf(quest.getNpcStringId()), state, "</fstring>");
|
||||
sb.append("<fstring>" + String.valueOf(quest.getNpcStringId()) + state + "</fstring>");
|
||||
}
|
||||
// sb.append("]</font></a><br>");
|
||||
sb.append("]</a><br>");
|
||||
|
@ -16,6 +16,9 @@
|
||||
*/
|
||||
package handlers.communityboard;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jmobius.gameserver.handler.CommunityBoardHandler;
|
||||
import com.l2jmobius.gameserver.handler.IWriteBoardHandler;
|
||||
@ -23,7 +26,6 @@ import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* Clan board.
|
||||
@ -147,32 +149,35 @@ public class ClanBoard implements IWriteBoardHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
final StringBuilder html = StringUtil.startAppend(2000, "<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a> > <a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), "\"> &$802; </a></td></tr></table>");
|
||||
final StringBuilder html = new StringBuilder(2048);
|
||||
html.append("<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a> > <a action=\"bypass _bbsclan_clanhome;");
|
||||
html.append(clanId);
|
||||
html.append("\"> &$802; </a></td></tr></table>");
|
||||
if (activeChar.isClanLeader())
|
||||
{
|
||||
StringUtil.append(html, "<br><br><center><table width=610 border=0 cellspacing=0 cellpadding=0><tr><td fixwidth=610><font color=\"AAAAAA\">The Clan Notice function allows the clan leader to send messages through a pop-up window to clan members at login.</font> </td></tr><tr><td height=20></td></tr>");
|
||||
html.append("<br><br><center><table width=610 border=0 cellspacing=0 cellpadding=0><tr><td fixwidth=610><font color=\"AAAAAA\">The Clan Notice function allows the clan leader to send messages through a pop-up window to clan members at login.</font> </td></tr><tr><td height=20></td></tr>");
|
||||
|
||||
if (activeChar.getClan().isNoticeEnabled())
|
||||
{
|
||||
StringUtil.append(html, "<tr><td fixwidth=610> Clan Notice Function: on / <a action=\"bypass _bbsclan_clannotice_disable\">off</a>");
|
||||
html.append("<tr><td fixwidth=610> Clan Notice Function: on / <a action=\"bypass _bbsclan_clannotice_disable\">off</a>");
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(html, "<tr><td fixwidth=610> Clan Notice Function: <a action=\"bypass _bbsclan_clannotice_enable\">on</a> / off");
|
||||
html.append("<tr><td fixwidth=610> Clan Notice Function: <a action=\"bypass _bbsclan_clannotice_enable\">on</a> / off");
|
||||
}
|
||||
|
||||
StringUtil.append(html, "</td></tr></table><img src=\"L2UI.Squaregray\" width=\"610\" height=\"1\"><br> <br><table width=610 border=0 cellspacing=2 cellpadding=0><tr><td>Edit Notice: </td></tr><tr><td height=5></td></tr><tr><td><MultiEdit var =\"Content\" width=610 height=100></td></tr></table><br><table width=610 border=0 cellspacing=0 cellpadding=0><tr><td height=5></td></tr><tr><td align=center FIXWIDTH=65><button value=\"&$140;\" action=\"Write Notice Set _ Content Content Content\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td><td align=center FIXWIDTH=45></td><td align=center FIXWIDTH=500></td></tr></table></center></body></html>");
|
||||
html.append("</td></tr></table><img src=\"L2UI.Squaregray\" width=\"610\" height=\"1\"><br> <br><table width=610 border=0 cellspacing=2 cellpadding=0><tr><td>Edit Notice: </td></tr><tr><td height=5></td></tr><tr><td><MultiEdit var =\"Content\" width=610 height=100></td></tr></table><br><table width=610 border=0 cellspacing=0 cellpadding=0><tr><td height=5></td></tr><tr><td align=center FIXWIDTH=65><button value=\"&$140;\" action=\"Write Notice Set _ Content Content Content\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td><td align=center FIXWIDTH=45></td><td align=center FIXWIDTH=500></td></tr></table></center></body></html>");
|
||||
|
||||
Util.sendCBHtml(activeChar, html.toString(), activeChar.getClan().getNotice());
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(html, "<img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=0><tr><td>You are not your clan's leader, and therefore cannot change the clan notice</td></tr></table>");
|
||||
html.append("<img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=0><tr><td>You are not your clan's leader, and therefore cannot change the clan notice</td></tr></table>");
|
||||
if (activeChar.getClan().isNoticeEnabled())
|
||||
{
|
||||
StringUtil.append(html, "<table border=0 cellspacing=0 cellpadding=0><tr><td>The current clan notice:</td></tr><tr><td fixwidth=5></td><td FIXWIDTH=600 align=left>" + activeChar.getClan().getNotice() + "</td><td fixqqwidth=5></td></tr></table>");
|
||||
html.append("<table border=0 cellspacing=0 cellpadding=0><tr><td>The current clan notice:</td></tr><tr><td fixwidth=5></td><td FIXWIDTH=600 align=left>" + activeChar.getClan().getNotice() + "</td><td fixqqwidth=5></td></tr></table>");
|
||||
}
|
||||
StringUtil.append(html, "</center></body></html>");
|
||||
html.append("</center></body></html>");
|
||||
CommunityBoardHandler.separateAndSend(html.toString(), activeChar);
|
||||
}
|
||||
}
|
||||
@ -187,7 +192,10 @@ public class ClanBoard implements IWriteBoardHandler
|
||||
}
|
||||
|
||||
// header
|
||||
final StringBuilder html = StringUtil.startAppend(2000, "<html><body><br><br><center><br1><br1><table border=0 cellspacing=0 cellpadding=0><tr><td FIXWIDTH=15> </td><td width=610 height=30 align=left><a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=610 bgcolor=434343><tr><td height=10></td></tr><tr><td fixWIDTH=5></td><td fixWIDTH=600><a action=\"bypass _bbsclan_clanhome;", String.valueOf((activeChar.getClan() != null) ? activeChar.getClan().getId() : 0), "\">[GO TO MY CLAN]</a> </td><td fixWIDTH=5></td></tr><tr><td height=10></td></tr></table><br><table border=0 cellspacing=0 cellpadding=2 bgcolor=5A5A5A width=610><tr><td FIXWIDTH=5></td><td FIXWIDTH=200 align=center>CLAN NAME</td><td FIXWIDTH=200 align=center>CLAN LEADER</td><td FIXWIDTH=100 align=center>CLAN LEVEL</td><td FIXWIDTH=100 align=center>CLAN MEMBERS</td><td FIXWIDTH=5></td></tr></table><img src=\"L2UI.Squareblank\" width=\"1\" height=\"5\">");
|
||||
final StringBuilder html = new StringBuilder(2048);
|
||||
html.append("<html><body><br><br><center><br1><br1><table border=0 cellspacing=0 cellpadding=0><tr><td FIXWIDTH=15> </td><td width=610 height=30 align=left><a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=610 bgcolor=434343><tr><td height=10></td></tr><tr><td fixWIDTH=5></td><td fixWIDTH=600><a action=\"bypass _bbsclan_clanhome;");
|
||||
html.append(activeChar.getClan() != null ? activeChar.getClan().getId() : 0);
|
||||
html.append("\">[GO TO MY CLAN]</a> </td><td fixWIDTH=5></td></tr><tr><td height=10></td></tr></table><br><table border=0 cellspacing=0 cellpadding=2 bgcolor=5A5A5A width=610><tr><td FIXWIDTH=5></td><td FIXWIDTH=200 align=center>CLAN NAME</td><td FIXWIDTH=200 align=center>CLAN LEADER</td><td FIXWIDTH=100 align=center>CLAN LEVEL</td><td FIXWIDTH=100 align=center>CLAN MEMBERS</td><td FIXWIDTH=5></td></tr></table><img src=\"L2UI.Squareblank\" width=\"1\" height=\"5\">");
|
||||
|
||||
int i = 0;
|
||||
for (L2Clan cl : ClanTable.getInstance().getClans())
|
||||
@ -199,7 +207,17 @@ public class ClanBoard implements IWriteBoardHandler
|
||||
|
||||
if (i++ >= ((index - 1) * 7))
|
||||
{
|
||||
StringUtil.append(html, "<img src=\"L2UI.SquareBlank\" width=\"610\" height=\"3\"><table border=0 cellspacing=0 cellpadding=0 width=610><tr> <td FIXWIDTH=5></td><td FIXWIDTH=200 align=center><a action=\"bypass _bbsclan_clanhome;", String.valueOf(cl.getId()), "\">", cl.getName(), "</a></td><td FIXWIDTH=200 align=center>", cl.getLeaderName(), "</td><td FIXWIDTH=100 align=center>", String.valueOf(cl.getLevel()), "</td><td FIXWIDTH=100 align=center>", String.valueOf(cl.getMembersCount()), "</td><td FIXWIDTH=5></td></tr><tr><td height=5></td></tr></table><img src=\"L2UI.SquareBlank\" width=\"610\" height=\"3\"><img src=\"L2UI.SquareGray\" width=\"610\" height=\"1\">");
|
||||
html.append("<img src=\"L2UI.SquareBlank\" width=\"610\" height=\"3\"><table border=0 cellspacing=0 cellpadding=0 width=610><tr> <td FIXWIDTH=5></td><td FIXWIDTH=200 align=center><a action=\"bypass _bbsclan_clanhome;");
|
||||
html.append(cl.getId());
|
||||
html.append("\">");
|
||||
html.append(cl.getName());
|
||||
html.append("</a></td><td FIXWIDTH=200 align=center>");
|
||||
html.append(cl.getLeaderName());
|
||||
html.append("</td><td FIXWIDTH=100 align=center>");
|
||||
html.append(cl.getLevel());
|
||||
html.append("</td><td FIXWIDTH=100 align=center>");
|
||||
html.append(cl.getMembersCount());
|
||||
html.append("</td><td FIXWIDTH=5></td></tr><tr><td height=5></td></tr></table><img src=\"L2UI.SquareBlank\" width=\"610\" height=\"3\"><img src=\"L2UI.SquareGray\" width=\"610\" height=\"1\">");
|
||||
}
|
||||
}
|
||||
|
||||
@ -211,7 +229,9 @@ public class ClanBoard implements IWriteBoardHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(html, "<td><button action=\"_bbsclan_clanlist;", String.valueOf(index - 1), "\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
|
||||
html.append("<td><button action=\"_bbsclan_clanlist;");
|
||||
html.append(index - 1);
|
||||
html.append("\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
|
||||
}
|
||||
|
||||
i = 0;
|
||||
@ -224,11 +244,17 @@ public class ClanBoard implements IWriteBoardHandler
|
||||
{
|
||||
if (i == index)
|
||||
{
|
||||
StringUtil.append(html, "<td> ", String.valueOf(i), " </td>");
|
||||
html.append("<td> ");
|
||||
html.append(i);
|
||||
html.append(" </td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(html, "<td><a action=\"bypass _bbsclan_clanlist;", String.valueOf(i), "\"> ", String.valueOf(i), " </a></td>");
|
||||
html.append("<td><a action=\"bypass _bbsclan_clanlist;");
|
||||
html.append(i);
|
||||
html.append("\"> ");
|
||||
html.append(i);
|
||||
html.append(" </a></td>");
|
||||
}
|
||||
|
||||
}
|
||||
@ -238,7 +264,9 @@ public class ClanBoard implements IWriteBoardHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(html, "<td><button action=\"bypass _bbsclan_clanlist;", String.valueOf(index + 1), "\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
|
||||
html.append("<td><button action=\"bypass _bbsclan_clanlist;");
|
||||
html.append(index + 1);
|
||||
html.append("\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
|
||||
}
|
||||
html.append("</tr></table><table border=0 cellspacing=0 cellpadding=0><tr><td width=610><img src=\"sek.cbui141\" width=\"610\" height=\"1\"></td></tr></table><table border=0><tr><td><combobox width=65 var=keyword list=\"Name;Ruler\"></td><td><edit var = \"Search\" width=130 height=11 length=\"16\"></td>" +
|
||||
// TODO: search (Write in BBS)
|
||||
@ -263,7 +291,7 @@ public class ClanBoard implements IWriteBoardHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
final String html = StringUtil.concat("<html><body><center><br><br><br1><br1><table border=0 cellspacing=0 cellpadding=0><tr><td FIXWIDTH=15> </td><td width=610 height=30 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a> > <a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), "\"> &$802; </a></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=610 bgcolor=434343><tr><td height=10></td></tr><tr><td fixWIDTH=5></td><td fixwidth=600><a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), ";announce\">[CLAN ANNOUNCEMENT]</a> <a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), ";cbb\">[CLAN BULLETIN BOARD]</a><a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), ";cmail\">[CLAN MAIL]</a> <a action=\"bypass _bbsclan_clannotice_edit;", String.valueOf(clanId), ";cnotice\">[CLAN NOTICE]</a> </td><td fixWIDTH=5></td></tr><tr><td height=10></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=610><tr><td height=10></td></tr><tr><td fixWIDTH=5></td><td fixwidth=290 valign=top></td><td fixWIDTH=5></td><td fixWIDTH=5 align=center valign=top><img src=\"l2ui.squaregray\" width=2 height=128></td><td fixWIDTH=5></td><td fixwidth=295><table border=0 cellspacing=0 cellpadding=0 width=295><tr><td fixWIDTH=100 align=left>CLAN NAME</td><td fixWIDTH=195 align=left>", cl.getName(), "</td></tr><tr><td height=7></td></tr><tr><td fixWIDTH=100 align=left>CLAN LEVEL</td><td fixWIDTH=195 align=left height=16>", String.valueOf(cl.getLevel()), "</td></tr><tr><td height=7></td></tr><tr><td fixWIDTH=100 align=left>CLAN MEMBERS</td><td fixWIDTH=195 align=left height=16>", String.valueOf(cl.getMembersCount()), "</td></tr><tr><td height=7></td></tr><tr><td fixWIDTH=100 align=left>CLAN LEADER</td><td fixWIDTH=195 align=left height=16>", cl.getLeaderName(), "</td></tr><tr><td height=7></td></tr>" +
|
||||
final String html = Arrays.asList("<html><body><center><br><br><br1><br1><table border=0 cellspacing=0 cellpadding=0><tr><td FIXWIDTH=15> </td><td width=610 height=30 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a> > <a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), "\"> &$802; </a></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=610 bgcolor=434343><tr><td height=10></td></tr><tr><td fixWIDTH=5></td><td fixwidth=600><a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), ";announce\">[CLAN ANNOUNCEMENT]</a> <a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), ";cbb\">[CLAN BULLETIN BOARD]</a><a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), ";cmail\">[CLAN MAIL]</a> <a action=\"bypass _bbsclan_clannotice_edit;", String.valueOf(clanId), ";cnotice\">[CLAN NOTICE]</a> </td><td fixWIDTH=5></td></tr><tr><td height=10></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=610><tr><td height=10></td></tr><tr><td fixWIDTH=5></td><td fixwidth=290 valign=top></td><td fixWIDTH=5></td><td fixWIDTH=5 align=center valign=top><img src=\"l2ui.squaregray\" width=2 height=128></td><td fixWIDTH=5></td><td fixwidth=295><table border=0 cellspacing=0 cellpadding=0 width=295><tr><td fixWIDTH=100 align=left>CLAN NAME</td><td fixWIDTH=195 align=left>", cl.getName(), "</td></tr><tr><td height=7></td></tr><tr><td fixWIDTH=100 align=left>CLAN LEVEL</td><td fixWIDTH=195 align=left height=16>", String.valueOf(cl.getLevel()), "</td></tr><tr><td height=7></td></tr><tr><td fixWIDTH=100 align=left>CLAN MEMBERS</td><td fixWIDTH=195 align=left height=16>", String.valueOf(cl.getMembersCount()), "</td></tr><tr><td height=7></td></tr><tr><td fixWIDTH=100 align=left>CLAN LEADER</td><td fixWIDTH=195 align=left height=16>", cl.getLeaderName(), "</td></tr><tr><td height=7></td></tr>" +
|
||||
// ADMINISTRATOR ??
|
||||
/*
|
||||
* html.append("<tr>"); html.append("<td fixWIDTH=100 align=left>ADMINISTRATOR</td>"); html.append("<td fixWIDTH=195 align=left height=16>"+cl.getLeaderName()+"</td>"); html.append("</tr>");
|
||||
@ -271,7 +299,7 @@ public class ClanBoard implements IWriteBoardHandler
|
||||
"<tr><td height=7></td></tr><tr><td fixWIDTH=100 align=left>ALLIANCE</td><td fixWIDTH=195 align=left height=16>", (cl.getAllyName() != null) ? cl.getAllyName() : "", "</td></tr></table></td><td fixWIDTH=5></td></tr><tr><td height=10></td></tr></table>" +
|
||||
// TODO: the BB for clan :)
|
||||
// html.append("<table border=0 cellspacing=0 cellpadding=0 width=610 bgcolor=333333>");
|
||||
"<img src=\"L2UI.squareblank\" width=\"1\" height=\"5\"><img src=\"L2UI.squaregray\" width=\"610\" height=\"1\"><br></center><br> <br></body></html>");
|
||||
"<img src=\"L2UI.squareblank\" width=\"1\" height=\"5\"><img src=\"L2UI.squaregray\" width=\"610\" height=\"1\"><br></center><br> <br></body></html>").stream().collect(Collectors.joining());
|
||||
CommunityBoardHandler.separateAndSend(html, activeChar);
|
||||
}
|
||||
}
|
||||
|
@ -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, "<html><body><center><table width=270 border=0 bgcolor=111111><tr><td width=170>Penalty</td><td width=100 align=center>Expiration Date</td></tr></table><table width=270 border=0><tr>");
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
final StringBuilder htmlContent = new StringBuilder(500);
|
||||
htmlContent.append("<html><body><center><table width=270 border=0 bgcolor=111111><tr><td width=170>Penalty</td><td width=100 align=center>Expiration Date</td></tr></table><table width=270 border=0><tr>");
|
||||
|
||||
if (activeChar.getClanJoinExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
StringUtil.append(htmlContent, "<td width=170>Unable to join a clan.</td><td width=100 align=center>", format.format(activeChar.getClanJoinExpiryTime()), "</td>");
|
||||
htmlContent.append("<td width=170>Unable to join a clan.</td><td width=100 align=center>");
|
||||
htmlContent.append(format.format(activeChar.getClanJoinExpiryTime()));
|
||||
htmlContent.append("</td>");
|
||||
penalty = true;
|
||||
}
|
||||
|
||||
if (activeChar.getClanCreateExpiryTime() > System.currentTimeMillis())
|
||||
{
|
||||
StringUtil.append(htmlContent, "<td width=170>Unable to create a clan.</td><td width=100 align=center>", format.format(activeChar.getClanCreateExpiryTime()), "</td>");
|
||||
htmlContent.append("<td width=170>Unable to create a clan.</td><td width=100 align=center>");
|
||||
htmlContent.append(format.format(activeChar.getClanCreateExpiryTime()));
|
||||
htmlContent.append("</td>");
|
||||
penalty = true;
|
||||
}
|
||||
|
||||
if ((activeChar.getClan() != null) && (activeChar.getClan().getCharPenaltyExpiryTime() > System.currentTimeMillis()))
|
||||
{
|
||||
StringUtil.append(htmlContent, "<td width=170>Unable to invite a clan member.</td><td width=100 align=center>", format.format(activeChar.getClan().getCharPenaltyExpiryTime()), "</td>");
|
||||
htmlContent.append("<td width=170>Unable to invite a clan member.</td><td width=100 align=center>");
|
||||
htmlContent.append(format.format(activeChar.getClan().getCharPenaltyExpiryTime()));
|
||||
htmlContent.append("</td>");
|
||||
penalty = true;
|
||||
}
|
||||
|
||||
|
@ -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, "<button value=\"", lang.toUpperCase(), "\" action=\"bypass -h voice .lang ", lang, "\" width=60 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>");
|
||||
html.append("<button value=\"" + lang.toUpperCase() + "\" action=\"bypass -h voice .lang " + lang + "\" width=60 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>");
|
||||
}
|
||||
|
||||
msg.setFile(activeChar.getHtmlPrefix(), "data/html/mods/Lang/LanguageSelect.htm");
|
||||
|
@ -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), "<html><body><center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br><br>Statistics for player <font color=\"LEVEL\">", pc.getName(), "</font><br>Total kills <font color=\"FF0000\">", String.valueOf(pc.getEventStatus().getKills().size()), "</font><br><br>Detailed list: <br>");
|
||||
final StringBuilder replyMSG = new StringBuilder(300 + (pc.getEventStatus().getKills().size() * 50));
|
||||
replyMSG.append("<html><body><center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br><br>Statistics for player <font color=\"LEVEL\">" + pc.getName() + "</font><br>Total kills <font color=\"FF0000\">" + pc.getEventStatus().getKills().size() + "</font><br><br>Detailed list: <br>");
|
||||
for (L2PcInstance plr : pc.getEventStatus().getKills())
|
||||
{
|
||||
StringUtil.append(replyMSG, "<font color=\"FF0000\">", plr.getName(), "</font><br>");
|
||||
replyMSG.append("<font color=\"FF0000\">" + plr.getName() + "</font><br>");
|
||||
}
|
||||
replyMSG.append("</body></html>");
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
|
@ -19,6 +19,7 @@ package instances;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.enums.InstanceReenterType;
|
||||
@ -42,6 +43,8 @@ import ai.npc.AbstractNpcAI;
|
||||
*/
|
||||
public abstract class AbstractInstance extends AbstractNpcAI
|
||||
{
|
||||
public final Logger _log = Logger.getLogger(getClass().getSimpleName());
|
||||
|
||||
public AbstractInstance(String name, String desc)
|
||||
{
|
||||
super(name, desc);
|
||||
@ -52,6 +55,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);
|
||||
@ -72,7 +80,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkConditions(player, templateId))
|
||||
if (checkConditions(player))
|
||||
{
|
||||
instance.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
|
||||
instance.setTemplateId(templateId);
|
||||
@ -188,11 +196,6 @@ public abstract class AbstractInstance extends AbstractNpcAI
|
||||
|
||||
protected abstract void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance);
|
||||
|
||||
protected boolean checkConditions(L2PcInstance player, int templateId)
|
||||
{
|
||||
return checkConditions(player);
|
||||
}
|
||||
|
||||
protected boolean checkConditions(L2PcInstance player)
|
||||
{
|
||||
return true;
|
||||
|
@ -208,7 +208,7 @@ public final class CavernOfThePirateCaptain extends AbstractInstance
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkConditions(L2PcInstance player, int templateId)
|
||||
protected boolean checkConditions(L2PcInstance player)
|
||||
{
|
||||
if (player.canOverrideCond(PcCondOverride.INSTANCE_CONDITIONS))
|
||||
{
|
||||
@ -221,8 +221,8 @@ public final class CavernOfThePirateCaptain extends AbstractInstance
|
||||
return false;
|
||||
}
|
||||
|
||||
final boolean is83 = templateId == TEMPLATE_ID_83;
|
||||
final boolean isNight = templateId == TEMPLATE_ID_60_NIGHT;
|
||||
final boolean is83 = InstanceManager.getInstance().getPlayerWorld(player).getTemplateId() == TEMPLATE_ID_83 ? true : false;
|
||||
final boolean isNight = InstanceManager.getInstance().getPlayerWorld(player).getTemplateId() == TEMPLATE_ID_60_NIGHT ? true : false;
|
||||
final L2Party party = player.getParty();
|
||||
final boolean isInCC = party.isInCommandChannel();
|
||||
final List<L2PcInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
|
||||
|
@ -35,10 +35,6 @@ import quests.Q10296_SevenSignsPowerOfTheSeal.Q10296_SevenSignsPowerOfTheSeal;
|
||||
*/
|
||||
public final class ElcadiasTent extends AbstractInstance
|
||||
{
|
||||
protected class ETWorld extends InstanceWorld
|
||||
{
|
||||
}
|
||||
|
||||
// NPCs
|
||||
private static final int ELCADIA = 32784;
|
||||
private static final int GRUFF_LOOKING_MAN = 32862;
|
||||
@ -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
|
||||
{
|
||||
|
@ -30,11 +30,6 @@ import instances.AbstractInstance;
|
||||
*/
|
||||
public final class HideoutOfTheDawn extends AbstractInstance
|
||||
{
|
||||
protected class HotDWorld extends InstanceWorld
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// NPCs
|
||||
private static final int WOOD = 32593;
|
||||
private static final int JAINA = 32617;
|
||||
@ -58,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:
|
||||
|
@ -31,11 +31,6 @@ import quests.Q10284_AcquisitionOfDivineSword.Q10284_AcquisitionOfDivineSword;
|
||||
*/
|
||||
public final class JiniaGuildHideout1 extends AbstractInstance
|
||||
{
|
||||
protected class JGH1World extends InstanceWorld
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// NPC
|
||||
private static final int RAFFORTY = 32020;
|
||||
// Location
|
||||
@ -56,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);
|
||||
|
@ -31,11 +31,6 @@ import quests.Q10285_MeetingSirra.Q10285_MeetingSirra;
|
||||
*/
|
||||
public final class JiniaGuildHideout2 extends AbstractInstance
|
||||
{
|
||||
protected class JGH2World extends InstanceWorld
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// NPC
|
||||
private static final int RAFFORTY = 32020;
|
||||
// Location
|
||||
@ -56,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);
|
||||
|
@ -31,11 +31,6 @@ import quests.Q10286_ReunionWithSirra.Q10286_ReunionWithSirra;
|
||||
*/
|
||||
public final class JiniaGuildHideout3 extends AbstractInstance
|
||||
{
|
||||
protected class JGH3World extends InstanceWorld
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// NPC
|
||||
private static final int RAFFORTY = 32020;
|
||||
// Location
|
||||
@ -56,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);
|
||||
|
@ -31,11 +31,6 @@ import quests.Q10287_StoryOfThoseLeft.Q10287_StoryOfThoseLeft;
|
||||
*/
|
||||
public final class JiniaGuildHideout4 extends AbstractInstance
|
||||
{
|
||||
protected class JGH4World extends InstanceWorld
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// NPC
|
||||
private static final int RAFFORTY = 32020;
|
||||
// Location
|
||||
@ -56,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);
|
||||
|
@ -34,11 +34,6 @@ import instances.AbstractInstance;
|
||||
*/
|
||||
public final class PailakaSongOfIceAndFire extends AbstractInstance
|
||||
{
|
||||
protected class PSoIWorld extends InstanceWorld
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// NPCs
|
||||
private static final int ADLER1 = 32497;
|
||||
private static final int GARGOS = 18607;
|
||||
@ -85,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":
|
||||
|
@ -61,7 +61,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;
|
||||
|
||||
/**
|
||||
@ -1450,7 +1449,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
|
||||
{
|
||||
@ -1462,7 +1461,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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1479,7 +1478,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
|
||||
{
|
||||
@ -1491,7 +1490,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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2069,7 +2068,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
|
||||
@ -2080,7 +2079,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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2170,7 +2169,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
|
||||
{
|
||||
@ -2182,7 +2181,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 + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2198,7 +2197,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
|
||||
{
|
||||
@ -2210,7 +2209,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 + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2346,7 +2345,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
|
||||
{
|
||||
@ -2362,7 +2361,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 + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2384,7 +2383,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 + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2400,7 +2399,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 + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2414,7 +2413,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
|
||||
{
|
||||
@ -2426,7 +2425,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 + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2442,7 +2441,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
|
||||
{
|
||||
@ -2454,7 +2453,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 + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2548,7 +2547,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
|
||||
{
|
||||
@ -2560,11 +2559,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] + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2617,7 +2616,7 @@ public final class Config
|
||||
final 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
|
||||
{
|
||||
@ -2629,7 +2628,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 + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2644,7 +2643,7 @@ public final class Config
|
||||
final 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
|
||||
{
|
||||
@ -2656,7 +2655,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 + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2970,7 +2969,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());
|
||||
}
|
||||
}
|
||||
@ -3008,11 +3007,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)
|
||||
@ -3185,7 +3184,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;
|
||||
}
|
||||
|
||||
@ -3196,7 +3195,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
|
||||
@ -3205,7 +3204,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;
|
||||
|
@ -30,7 +30,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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("<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsmemo\">", forum.getName(), " Form</a></td></tr></table><img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=0><tr><td width=610><img src=\"sek.cbui355\" width=\"610\" height=\"1\"><br1><img src=\"sek.cbui355\" width=\"610\" height=\"1\"></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=20></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29>&$413;</td><td FIXWIDTH=540>", topic.getName(), "</td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29 valign=top>&$427;</td><td align=center FIXWIDTH=540><MultiEdit var =\"Content\" width=535 height=313></td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29> </td><td align=center FIXWIDTH=70><button value=\"&$140;\" action=\"Write Post ", String.valueOf(forum.getID()), ";", String.valueOf(topic.getID()), ";0 _ Content Content Content\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td><td align=center FIXWIDTH=70><button value = \"&$141;\" action=\"bypass _bbsmemo\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"> </td><td align=center FIXWIDTH=400> </td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr></table></center></body></html>");
|
||||
final String html = "<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsmemo\">" + forum.getName() + " Form</a></td></tr></table><img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=0><tr><td width=610><img src=\"sek.cbui355\" width=\"610\" height=\"1\"><br1><img src=\"sek.cbui355\" width=\"610\" height=\"1\"></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=20></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29>&$413;</td><td FIXWIDTH=540>" + topic.getName() + "</td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29 valign=top>&$427;</td><td align=center FIXWIDTH=540><MultiEdit var =\"Content\" width=535 height=313></td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29> </td><td align=center FIXWIDTH=70><button value=\"&$140;\" action=\"Write Post " + forum.getID() + ";" + topic.getID() + ";0 _ Content Content Content\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td><td align=center FIXWIDTH=70><button value = \"&$141;\" action=\"bypass _bbsmemo\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"> </td><td align=center FIXWIDTH=400> </td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr></table></center></body></html>";
|
||||
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("<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsmemo\">Memo Form</a></td></tr></table><img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=0 bgcolor=333333><tr><td height=10></td></tr><tr><td fixWIDTH=55 align=right valign=top>&$413; : </td><td fixWIDTH=380 valign=top>", topic.getName(), "</td><td fixwidth=5></td><td fixwidth=50></td><td fixWIDTH=120></td></tr><tr><td height=10></td></tr><tr><td align=right><font color=\"AAAAAA\" >&$417; : </font></td><td><font color=\"AAAAAA\">", topic.getOwnerName() + "</font></td><td></td><td><font color=\"AAAAAA\">&$418; :</font></td><td><font color=\"AAAAAA\">", DateFormat.getDateInstance(DateFormat.FULL, Locale.getDefault()).format(p.getCPost(0).postDate), "</font></td></tr><tr><td height=10></td></tr></table><br><table border=0 cellspacing=0 cellpadding=0><tr><td fixwidth=5></td><td FIXWIDTH=600 align=left>", p.getCPost(0).postTxt.replace(">", ">").replace("<", "<"), "</td><td fixqqwidth=5></td></tr></table><br><img src=\"L2UI.squareblank\" width=\"1\" height=\"5\"><img src=\"L2UI.squaregray\" width=\"610\" height=\"1\"><img src=\"L2UI.squareblank\" width=\"1\" height=\"5\"><table border=0 cellspacing=0 cellpadding=0 FIXWIDTH=610><tr><td width=50><button value=\"&$422;\" action=\"bypass _bbsmemo\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"></td><td width=560 align=right><table border=0 cellspacing=0><tr><td FIXWIDTH=300></td><td><button value = \"&$424;\" action=\"bypass _bbsposts;edit;", String.valueOf(forum.getID()), ";", String.valueOf(topic.getID()), ";0\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td> <td><button value = \"&$425;\" action=\"bypass _bbstopics;del;", String.valueOf(forum.getID()), ";", String.valueOf(topic.getID()), "\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td> <td><button value = \"&$421;\" action=\"bypass _bbstopics;crea;", String.valueOf(forum.getID()), "\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td> </tr></table></td></tr></table><br><br><br></center></body></html>"), 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 = "<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsmemo\">Memo Form</a></td></tr></table><img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=0 bgcolor=333333><tr><td height=10></td></tr><tr><td fixWIDTH=55 align=right valign=top>&$413; : </td><td fixWIDTH=380 valign=top>" + topic.getName() + "</td><td fixwidth=5></td><td fixwidth=50></td><td fixWIDTH=120></td></tr><tr><td height=10></td></tr><tr><td align=right><font color=\"AAAAAA\" >&$417; : </font></td><td><font color=\"AAAAAA\">" + topic.getOwnerName() + "</font></td><td></td><td><font color=\"AAAAAA\">&$418; :</font></td><td><font color=\"AAAAAA\">" + dateFormat.format(p.getCPost(0).postDate) + "</font></td></tr><tr><td height=10></td></tr></table><br><table border=0 cellspacing=0 cellpadding=0><tr><td fixwidth=5></td><td FIXWIDTH=600 align=left>" + mes + "</td><td fixqqwidth=5></td></tr></table><br><img src=\"L2UI.squareblank\" width=\"1\" height=\"5\"><img src=\"L2UI.squaregray\" width=\"610\" height=\"1\"><img src=\"L2UI.squareblank\" width=\"1\" height=\"5\"><table border=0 cellspacing=0 cellpadding=0 FIXWIDTH=610><tr><td width=50><button value=\"&$422;\" action=\"bypass _bbsmemo\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"></td><td width=560 align=right><table border=0 cellspacing=0><tr><td FIXWIDTH=300></td><td><button value = \"&$424;\" action=\"bypass _bbsposts;edit;" + forum.getID() + ";" + topic.getID() + ";0\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td> <td><button value = \"&$425;\" action=\"bypass _bbstopics;del;" + forum.getID() + ";" + topic.getID() + "\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td> <td><button value = \"&$421;\" action=\"bypass _bbstopics;crea;" + forum.getID() + "\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td> </tr></table></td></tr></table><br><br><br></center></body></html>";
|
||||
CommunityBoardHandler.separateAndSend(html, activeChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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("<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsmemo\">Memo Form</a></td></tr></table><img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=0><tr><td width=610><img src=\"sek.cbui355\" width=\"610\" height=\"1\"><br1><img src=\"sek.cbui355\" width=\"610\" height=\"1\"></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=20></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29>&$413;</td><td FIXWIDTH=540><edit var = \"Title\" width=540 height=13></td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29 valign=top>&$427;</td><td align=center FIXWIDTH=540><MultiEdit var =\"Content\" width=535 height=313></td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29> </td><td align=center FIXWIDTH=70><button value=\"&$140;\" action=\"Write Topic crea ", String.valueOf(forum.getID()), " Title Content Title\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td><td align=center FIXWIDTH=70><button value = \"&$141;\" action=\"bypass _bbsmemo\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"> </td><td align=center FIXWIDTH=400> </td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr></table></center></body></html>");
|
||||
final String html = "<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsmemo\">Memo Form</a></td></tr></table><img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=0><tr><td width=610><img src=\"sek.cbui355\" width=\"610\" height=\"1\"><br1><img src=\"sek.cbui355\" width=\"610\" height=\"1\"></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=20></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29>&$413;</td><td FIXWIDTH=540><edit var = \"Title\" width=540 height=13></td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29 valign=top>&$427;</td><td align=center FIXWIDTH=540><MultiEdit var =\"Content\" width=535 height=313></td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr></table><table fixwidth=610 border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=1></td><td align=center FIXWIDTH=60 height=29> </td><td align=center FIXWIDTH=70><button value=\"&$140;\" action=\"Write Topic crea " + forum.getID() + " Title Content Title\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td><td align=center FIXWIDTH=70><button value = \"&$141;\" action=\"bypass _bbsmemo\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"> </td><td align=center FIXWIDTH=400> </td><td><img src=\"l2ui.mini_logo\" width=5 height=1></td></tr></table></center></body></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, "<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsmemo\">Memo Form</a></td></tr></table><img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=2 bgcolor=888888 width=610><tr><td FIXWIDTH=5></td><td FIXWIDTH=415 align=center>&$413;</td><td FIXWIDTH=120 align=center></td><td FIXWIDTH=70 align=center>&$418;</td></tr></table>");
|
||||
final StringBuilder html = new StringBuilder(2000);
|
||||
html.append("<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsmemo\">Memo Form</a></td></tr></table><img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=2 bgcolor=888888 width=610><tr><td FIXWIDTH=5></td><td FIXWIDTH=415 align=center>&$413;</td><td FIXWIDTH=120 align=center></td><td FIXWIDTH=70 align=center>&$418;</td></tr></table>");
|
||||
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, "<table border=0 cellspacing=0 cellpadding=5 WIDTH=610><tr><td FIXWIDTH=5></td><td FIXWIDTH=415><a action=\"bypass _bbsposts;read;", String.valueOf(forum.getID()), ";", String.valueOf(t.getID()), "\">", t.getName(), "</a></td><td FIXWIDTH=120 align=center></td><td FIXWIDTH=70 align=center>", dateFormat.format(new Date(t.getDate())), "</td></tr></table><img src=\"L2UI.Squaregray\" width=\"610\" height=\"1\">");
|
||||
if (i++ >= (12 * (index - 1)))
|
||||
{
|
||||
html.append("<table border=0 cellspacing=0 cellpadding=5 WIDTH=610><tr><td FIXWIDTH=5></td><td FIXWIDTH=415><a action=\"bypass _bbsposts;read;" + forum.getID() + ";" + t.getID() + "\">" + t.getName() + "</a></td><td FIXWIDTH=120 align=center></td><td FIXWIDTH=70 align=center>" + dateFormat.format(new Date(t.getDate())) + "</td></tr></table><img src=\"L2UI.Squaregray\" width=\"610\" height=\"1\">");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -259,7 +262,7 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(html, "<td><button action=\"bypass _bbstopics;read;", String.valueOf(forum.getID()), ";", String.valueOf(index - 1), "\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
|
||||
html.append("<td><button action=\"bypass _bbstopics;read;" + forum.getID() + ";" + (index - 1) + "\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
|
||||
}
|
||||
|
||||
int nbp = forum.getTopicSize() / 8;
|
||||
@ -271,11 +274,11 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
{
|
||||
if (i == index)
|
||||
{
|
||||
StringUtil.append(html, "<td> ", String.valueOf(i), " </td>");
|
||||
html.append("<td> " + i + " </td>");
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(html, "<td><a action=\"bypass _bbstopics;read;", String.valueOf(forum.getID()), ";", String.valueOf(i), "\"> ", String.valueOf(i), " </a></td>");
|
||||
html.append("<td><a action=\"bypass _bbstopics;read;" + forum.getID() + ";" + i + "\"> " + i + " </a></td>");
|
||||
}
|
||||
}
|
||||
if (index == nbp)
|
||||
@ -284,10 +287,10 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(html, "<td><button action=\"bypass _bbstopics;read;", String.valueOf(forum.getID()), ";", String.valueOf(index + 1), "\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
|
||||
html.append("<td><button action=\"bypass _bbstopics;read;" + forum.getID() + ";" + (index + 1) + "\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
|
||||
}
|
||||
|
||||
StringUtil.append(html, "</tr></table> </td> <td align=right><button value = \"&$421;\" action=\"bypass _bbstopics;crea;", String.valueOf(forum.getID()), "\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr><tr> <td></td><td align=center><table border=0><tr><td></td><td><edit var = \"Search\" width=130 height=11></td><td><button value=\"&$420;\" action=\"Write 5 -2 0 Search _ _\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"> </td> </tr></table> </td></tr></table><br><br><br></center></body></html>");
|
||||
html.append("</tr></table> </td> <td align=right><button value = \"&$421;\" action=\"bypass _bbstopics;crea;" + forum.getID() + "\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td></tr><tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr><tr> <td></td><td align=center><table border=0><tr><td></td><td><edit var = \"Search\" width=130 height=11></td><td><button value=\"&$420;\" action=\"Write 5 -2 0 Search _ _\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"> </td> </tr></table> </td></tr></table><br><br><br></center></body></html>");
|
||||
CommunityBoardHandler.separateAndSend(html.toString(), activeChar);
|
||||
}
|
||||
|
||||
|
@ -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<String, Object> parameters = null;
|
||||
Map<Integer, Skill> skills = null;
|
||||
|
@ -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 + ".");
|
||||
|
@ -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), "<html><body><center><table width=270><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Petition Menu</center></td><td width=45><button value=\"Back\" action=\"bypass -h admin_admin7\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><table width=\"270\"><tr><td><table width=\"270\"><tr><td><button value=\"Reset\" action=\"bypass -h admin_reset_petitions\" width=\"80\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td align=right><button value=\"Refresh\" action=\"bypass -h admin_view_petitions\" width=\"80\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br></td></tr>");
|
||||
final StringBuilder htmlContent = new StringBuilder(600 + (getPendingPetitionCount() * 300));
|
||||
htmlContent.append("<html><body><center><table width=270><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Petition Menu</center></td><td width=45><button value=\"Back\" action=\"bypass -h admin_admin7\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><table width=\"270\"><tr><td><table width=\"270\"><tr><td><button value=\"Reset\" action=\"bypass -h admin_reset_petitions\" width=\"80\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td align=right><button value=\"Refresh\" action=\"bypass -h admin_view_petitions\" width=\"80\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br></td></tr>");
|
||||
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
@ -374,18 +374,18 @@ public final class PetitionManager
|
||||
continue;
|
||||
}
|
||||
|
||||
StringUtil.append(htmlContent, "<tr><td width=\"270\"><table width=\"270\" cellpadding=\"2\" bgcolor=", color ? "131210" : "444444", "><tr><td width=\"130\">", dateFormat.format(new Date(currPetition.getSubmitTime())));
|
||||
StringUtil.append(htmlContent, "</td><td width=\"140\" align=right><font color=\"", currPetition.getPetitioner().isOnline() ? "00FF00" : "999999", "\">", currPetition.getPetitioner().getName(), "</font></td></tr>");
|
||||
StringUtil.append(htmlContent, "<tr><td width=\"130\">");
|
||||
htmlContent.append("<tr><td width=\"270\"><table width=\"270\" cellpadding=\"2\" bgcolor=" + (color ? "131210" : "444444") + "><tr><td width=\"130\">" + dateFormat.format(new Date(currPetition.getSubmitTime())));
|
||||
htmlContent.append("</td><td width=\"140\" align=right><font color=\"" + (currPetition.getPetitioner().isOnline() ? "00FF00" : "999999") + "\">" + currPetition.getPetitioner().getName() + "</font></td></tr>");
|
||||
htmlContent.append("<tr><td width=\"130\">");
|
||||
if (currPetition.getState() != PetitionState.IN_PROCESS)
|
||||
{
|
||||
StringUtil.append(htmlContent, "<table width=\"130\" cellpadding=\"2\"><tr><td><button value=\"View\" action=\"bypass -h admin_view_petition ", String.valueOf(currPetition.getId()), "\" width=\"50\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Reject\" action=\"bypass -h admin_reject_petition ", String.valueOf(currPetition.getId()), "\" width=\"50\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table>");
|
||||
htmlContent.append("<table width=\"130\" cellpadding=\"2\"><tr><td><button value=\"View\" action=\"bypass -h admin_view_petition " + currPetition.getId() + "\" width=\"50\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Reject\" action=\"bypass -h admin_reject_petition " + currPetition.getId() + "\" width=\"50\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table>");
|
||||
}
|
||||
else
|
||||
{
|
||||
htmlContent.append("<font color=\"" + (currPetition.getResponder().isOnline() ? "00FF00" : "999999") + "\">" + currPetition.getResponder().getName() + "</font>");
|
||||
}
|
||||
StringUtil.append(htmlContent, "</td>", currPetition.getTypeAsString(), "<td width=\"140\" align=right>", currPetition.getTypeAsString(), "</td></tr></table></td></tr>");
|
||||
htmlContent.append("</td>" + currPetition.getTypeAsString() + "<td width=\"140\" align=right>" + currPetition.getTypeAsString() + "</td></tr></table></td></tr>");
|
||||
color = !color;
|
||||
petcount++;
|
||||
if (petcount > 10)
|
||||
|
@ -35,7 +35,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
|
||||
{
|
||||
@ -141,10 +140,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(';');
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ import com.l2jmobius.gameserver.network.serverpackets.TutorialCloseHtml;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.TutorialShowHtml;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.TutorialShowQuestionMark;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
@ -273,7 +272,7 @@ public final class L2ClassMasterInstance extends L2MerchantInstance
|
||||
}
|
||||
if (validateClassId(currentClassId, cid) && (cid.level() == level))
|
||||
{
|
||||
StringUtil.append(menu, "<a action=\"bypass -h npc_%objectId%_change_class ", String.valueOf(cid.getId()), "\">", ClassListData.getInstance().getClass(cid).getClientCode(), "</a><br>");
|
||||
menu.append("<a action=\"bypass -h npc_%objectId%_change_class " + cid.getId() + "\">" + ClassListData.getInstance().getClass(cid).getClientCode() + "</a><br>");
|
||||
}
|
||||
}
|
||||
|
||||
@ -329,7 +328,7 @@ public final class L2ClassMasterInstance extends L2MerchantInstance
|
||||
}
|
||||
if (validateClassId(currentClassId, cid))
|
||||
{
|
||||
StringUtil.append(menu, "<a action=\"link CO", String.valueOf(cid.getId()), "\">", ClassListData.getInstance().getClass(cid).getEscapedClientCode(), "</a><br>");
|
||||
menu.append("<a action=\"link CO" + cid.getId() + "\">" + ClassListData.getInstance().getClass(cid).getEscapedClientCode() + "</a><br>");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* Festival of Darkness Guide (Seven Signs)
|
||||
@ -226,7 +225,7 @@ public final class L2FestivalGuideInstance extends L2Npc
|
||||
winningCabal = "None";
|
||||
}
|
||||
|
||||
StringUtil.append(tableHtml, "<tr><td width=\"100\" align=\"center\">", festivalName, "</td><td align=\"center\" width=\"35\">", String.valueOf(duskScore), "</td><td align=\"center\" width=\"35\">", String.valueOf(dawnScore), "</td><td align=\"center\" width=\"130\">", winningCabal, "</td></tr>");
|
||||
tableHtml.append("<tr><td width=\"100\" align=\"center\">" + festivalName + "</td><td align=\"center\" width=\"35\">" + String.valueOf(duskScore) + "</td><td align=\"center\" width=\"35\">" + String.valueOf(dawnScore) + "</td><td align=\"center\" width=\"130\">" + winningCabal + "</td></tr>");
|
||||
}
|
||||
|
||||
return tableHtml.toString();
|
||||
@ -242,7 +241,7 @@ public final class L2FestivalGuideInstance extends L2Npc
|
||||
final int accumScore = SevenSignsFestival.getInstance().getAccumulatedBonus(i);
|
||||
final String festivalName = SevenSignsFestival.getFestivalName(i);
|
||||
|
||||
StringUtil.append(tableHtml, "<tr><td align=\"center\" width=\"150\">", festivalName, "</td><td align=\"center\" width=\"150\">", String.valueOf(accumScore), "</td></tr>");
|
||||
tableHtml.append("<tr><td align=\"center\" width=\"150\">" + festivalName + "</td><td align=\"center\" width=\"150\">" + String.valueOf(accumScore) + "</td></tr>");
|
||||
}
|
||||
|
||||
return tableHtml.toString();
|
||||
|
@ -34,7 +34,6 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
public class L2NpcInstance extends L2Npc
|
||||
{
|
||||
@ -127,7 +126,7 @@ public class L2NpcInstance extends L2Npc
|
||||
if (((L2NpcInstance) npc).getClassesToTeach().isEmpty())
|
||||
{
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
||||
final String sb = StringUtil.concat("<html><body>I cannot teach you. My class list is empty.<br>Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.<br>NpcId:", String.valueOf(npcId), ", Your classId:", String.valueOf(player.getClassId().getId()), "</body></html>");
|
||||
final String sb = "<html><body>I cannot teach you. My class list is empty.<br>Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.<br>NpcId:" + npcId + ", Your classId:" + player.getClassId().getId() + "</body></html>";
|
||||
html.setHtml(sb);
|
||||
player.sendPacket(html);
|
||||
return;
|
||||
|
@ -56,7 +56,6 @@ import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
@ -374,10 +373,10 @@ public class L2VillageMasterInstance extends L2NpcInstance
|
||||
if ((subsAvailable != null) && !subsAvailable.isEmpty())
|
||||
{
|
||||
html.setFile(player.getHtmlPrefix(), "data/html/villagemaster/SubClass_Add.htm");
|
||||
final StringBuilder content1 = StringUtil.startAppend(200);
|
||||
final StringBuilder content1 = new StringBuilder(200);
|
||||
for (PlayerClass subClass : subsAvailable)
|
||||
{
|
||||
StringUtil.append(content1, "<a action=\"bypass -h npc_%objectId%_Subclass 4 ", String.valueOf(subClass.ordinal()), "\" msg=\"1268;", ClassListData.getInstance().getClass(subClass.ordinal()).getClassName(), "\">", ClassListData.getInstance().getClass(subClass.ordinal()).getClientCode(), "</a><br>");
|
||||
content1.append("<a action=\"bypass -h npc_%objectId%_Subclass 4 " + String.valueOf(subClass.ordinal()) + "\" msg=\"1268;" + ClassListData.getInstance().getClass(subClass.ordinal()).getClassName() + "\">" + ClassListData.getInstance().getClass(subClass.ordinal()).getClientCode() + "</a><br>");
|
||||
}
|
||||
html.replace("%list%", content1.toString());
|
||||
}
|
||||
@ -408,10 +407,10 @@ public class L2VillageMasterInstance extends L2NpcInstance
|
||||
}
|
||||
else
|
||||
{
|
||||
final StringBuilder content2 = StringUtil.startAppend(200);
|
||||
final StringBuilder content2 = new StringBuilder(200);
|
||||
if (checkVillageMaster(player.getBaseClass()))
|
||||
{
|
||||
StringUtil.append(content2, "<a action=\"bypass -h npc_%objectId%_Subclass 5 0\">", ClassListData.getInstance().getClass(player.getBaseClass()).getClientCode(), "</a><br>");
|
||||
content2.append("<a action=\"bypass -h npc_%objectId%_Subclass 5 0\">" + ClassListData.getInstance().getClass(player.getBaseClass()).getClientCode() + "</a><br>");
|
||||
}
|
||||
|
||||
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
|
||||
@ -419,7 +418,7 @@ public class L2VillageMasterInstance extends L2NpcInstance
|
||||
final SubClass subClass = subList.next();
|
||||
if (checkVillageMaster(subClass.getClassDefinition()))
|
||||
{
|
||||
StringUtil.append(content2, "<a action=\"bypass -h npc_%objectId%_Subclass 5 ", String.valueOf(subClass.getClassIndex()), "\">", ClassListData.getInstance().getClass(subClass.getClassId()).getClientCode(), "</a><br>");
|
||||
content2.append("<a action=\"bypass -h npc_%objectId%_Subclass 5 " + String.valueOf(subClass.getClassIndex()) + "\">" + ClassListData.getInstance().getClass(subClass.getClassId()).getClientCode() + "</a><br>");
|
||||
}
|
||||
}
|
||||
|
||||
@ -445,14 +444,14 @@ public class L2VillageMasterInstance extends L2NpcInstance
|
||||
if (player.getTotalSubClasses() > 3)
|
||||
{
|
||||
html.setFile(player.getHtmlPrefix(), "data/html/villagemaster/SubClass_ModifyCustom.htm");
|
||||
final StringBuilder content3 = StringUtil.startAppend(200);
|
||||
final StringBuilder content3 = new StringBuilder(200);
|
||||
int classIndex = 1;
|
||||
|
||||
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
|
||||
{
|
||||
final SubClass subClass = subList.next();
|
||||
|
||||
StringUtil.append(content3, "Sub-class ", String.valueOf(classIndex++), "<br>", "<a action=\"bypass -h npc_%objectId%_Subclass 6 ", String.valueOf(subClass.getClassIndex()), "\">", ClassListData.getInstance().getClass(subClass.getClassId()).getClientCode(), "</a><br>");
|
||||
content3.append("Sub-class " + String.valueOf(classIndex++) + "<br><a action=\"bypass -h npc_%objectId%_Subclass 6 " + String.valueOf(subClass.getClassIndex()) + "\">" + ClassListData.getInstance().getClass(subClass.getClassId()).getClientCode() + "</a><br>");
|
||||
}
|
||||
html.replace("%list%", content3.toString());
|
||||
}
|
||||
@ -611,10 +610,10 @@ public class L2VillageMasterInstance extends L2NpcInstance
|
||||
return;
|
||||
}
|
||||
|
||||
final StringBuilder content6 = StringUtil.startAppend(200);
|
||||
final StringBuilder content6 = new StringBuilder(200);
|
||||
for (PlayerClass subClass : subsAvailable)
|
||||
{
|
||||
StringUtil.append(content6, "<a action=\"bypass -h npc_%objectId%_Subclass 7 ", String.valueOf(paramOne), " ", String.valueOf(subClass.ordinal()), "\" msg=\"1445;", "\">", ClassListData.getInstance().getClass(subClass.ordinal()).getClientCode(), "</a><br>");
|
||||
content6.append("<a action=\"bypass -h npc_%objectId%_Subclass 7 " + String.valueOf(paramOne) + " " + String.valueOf(subClass.ordinal()) + "\" msg=\"1445;\">" + ClassListData.getInstance().getClass(subClass.ordinal()).getClientCode() + "</a><br>");
|
||||
}
|
||||
|
||||
switch (paramOne)
|
||||
|
@ -55,7 +55,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.
|
||||
@ -465,19 +464,19 @@ public class Hero
|
||||
{
|
||||
breakat = i;
|
||||
final StatsSet diaryEntry = list.get(i);
|
||||
StringUtil.append(fList, "<tr><td>");
|
||||
fList.append("<tr><td>");
|
||||
if (color)
|
||||
{
|
||||
StringUtil.append(fList, "<table width=270 bgcolor=\"131210\">");
|
||||
fList.append("<table width=270 bgcolor=\"131210\">");
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(fList, "<table width=270>");
|
||||
fList.append("<table width=270>");
|
||||
}
|
||||
StringUtil.append(fList, "<tr><td width=270><font color=\"LEVEL\">" + diaryEntry.getString("date") + ":xx</font></td></tr>");
|
||||
StringUtil.append(fList, "<tr><td width=270>" + diaryEntry.getString("action") + "</td></tr>");
|
||||
StringUtil.append(fList, "<tr><td> </td></tr></table>");
|
||||
StringUtil.append(fList, "</td></tr>");
|
||||
fList.append("<tr><td width=270><font color=\"LEVEL\">" + diaryEntry.getString("date") + ":xx</font></td></tr>");
|
||||
fList.append("<tr><td width=270>" + diaryEntry.getString("action") + "</td></tr>");
|
||||
fList.append("<tr><td> </td></tr></table>");
|
||||
fList.append("</td></tr>");
|
||||
color = !color;
|
||||
counter++;
|
||||
if (counter >= perpage)
|
||||
@ -553,19 +552,19 @@ public class Hero
|
||||
{
|
||||
breakat = i;
|
||||
final StatsSet fight = heroFights.get(i);
|
||||
StringUtil.append(fList, "<tr><td>");
|
||||
fList.append("<tr><td>");
|
||||
if (color)
|
||||
{
|
||||
StringUtil.append(fList, "<table width=270 bgcolor=\"131210\">");
|
||||
fList.append("<table width=270 bgcolor=\"131210\">");
|
||||
}
|
||||
else
|
||||
{
|
||||
StringUtil.append(fList, "<table width=270>");
|
||||
fList.append("<table width=270>");
|
||||
}
|
||||
StringUtil.append(fList, "<tr><td width=220><font color=\"LEVEL\">" + fight.getString("start") + "</font> " + fight.getString("result") + "</td><td width=50 align=right>" + (fight.getInt("classed") > 0 ? "<font color=\"FFFF99\">cls</font>" : "<font color=\"999999\">non-cls<font>") + "</td></tr>");
|
||||
StringUtil.append(fList, "<tr><td width=220>vs " + fight.getString("oponent") + " (" + fight.getString("oponentclass") + ")</td><td width=50 align=right>(" + fight.getString("time") + ")</td></tr>");
|
||||
StringUtil.append(fList, "<tr><td colspan=2> </td></tr></table>");
|
||||
StringUtil.append(fList, "</td></tr>");
|
||||
fList.append("<tr><td width=220><font color=\"LEVEL\">" + fight.getString("start") + "</font> " + fight.getString("result") + "</td><td width=50 align=right>" + (fight.getInt("classed") > 0 ? "<font color=\"FFFF99\">cls</font>" : "<font color=\"999999\">non-cls<font>") + "</td></tr>");
|
||||
fList.append("<tr><td width=220>vs " + fight.getString("oponent") + " (" + fight.getString("oponentclass") + ")</td><td width=50 align=right>(" + fight.getString("time") + ")</td></tr>");
|
||||
fList.append("<tr><td colspan=2> </td></tr></table>");
|
||||
fList.append("</td></tr>");
|
||||
color = !color;
|
||||
counter++;
|
||||
if (counter >= perpage)
|
||||
|
@ -55,7 +55,6 @@ import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.StatusUpdate;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.util.Rnd;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* @author HorridoJoho
|
||||
@ -543,7 +542,7 @@ public class TvTEvent
|
||||
return "-";
|
||||
}
|
||||
|
||||
return StringUtil.concat(String.valueOf(itemNum), " ", ItemTable.getInstance().getTemplate(itemId).getName());
|
||||
return itemNum + " " + ItemTable.getInstance().getTemplate(itemId).getName();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,7 +41,7 @@ import com.l2jmobius.gameserver.model.items.type.EtcItemType;
|
||||
import com.l2jmobius.gameserver.model.items.type.WeaponType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
import com.l2jmobius.util.Util;
|
||||
|
||||
/**
|
||||
* This class manages inventory
|
||||
@ -1325,7 +1325,7 @@ public abstract class Inventory extends ItemContainer
|
||||
break;
|
||||
default:
|
||||
_log.info("Unhandled slot type: " + slot);
|
||||
_log.info(StringUtil.getTraceString(Thread.currentThread().getStackTrace()));
|
||||
_log.info(Util.getTraceString(Thread.currentThread().getStackTrace()));
|
||||
}
|
||||
if (pdollSlot >= 0)
|
||||
{
|
||||
|
@ -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))
|
||||
{
|
||||
|
@ -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.
|
||||
@ -93,7 +92,7 @@ public final class L2EtcItem extends L2Item
|
||||
final String[] data = part.split(",");
|
||||
if (data.length != 4)
|
||||
{
|
||||
_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]);
|
||||
@ -102,7 +101,7 @@ public final class L2EtcItem extends L2Item
|
||||
final double chance = Double.parseDouble(data[3]);
|
||||
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 L2ExtractableProduct product = new L2ExtractableProduct(itemId, min, max, chance);
|
||||
|
@ -46,7 +46,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).<BR>
|
||||
@ -221,13 +220,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;
|
||||
}
|
||||
|
||||
@ -236,7 +235,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]");
|
||||
}
|
||||
}
|
||||
|
||||
@ -265,7 +264,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))
|
||||
{
|
||||
|
@ -33,7 +33,6 @@ 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.
|
||||
@ -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))
|
||||
{
|
||||
|
@ -535,7 +535,11 @@ public final class QuestState
|
||||
*/
|
||||
public int getCond()
|
||||
{
|
||||
return isStarted() ? getInt("cond") : 0;
|
||||
if (isStarted())
|
||||
{
|
||||
return getInt("cond");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -585,7 +589,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)
|
||||
@ -600,7 +608,11 @@ public final class QuestState
|
||||
*/
|
||||
public int getMemoStateEx(int slot)
|
||||
{
|
||||
return isStarted() ? getInt("memoStateEx" + slot) : 0;
|
||||
if (isStarted())
|
||||
{
|
||||
return getInt("memoStateEx" + slot);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -37,7 +37,6 @@ import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ItemList;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.StatusUpdate;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.util.StringUtil;
|
||||
|
||||
/**
|
||||
* @author Migi, DS
|
||||
@ -309,7 +308,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
|
||||
|
@ -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;
|
||||
@ -32,7 +30,7 @@ public class ShowBoard extends L2GameServerPacket
|
||||
|
||||
public ShowBoard(List<String> 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");
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public final class JavaExecutionContext extends AbstractExecutionContext<JavaScr
|
||||
super(engine);
|
||||
}
|
||||
|
||||
private boolean addOptionIfNotNull(final LinkedList<String> list, final String nullChecked, final String before)
|
||||
private boolean addOptionIfNotNull(List<String> list, String nullChecked, String before)
|
||||
{
|
||||
if (nullChecked == null)
|
||||
{
|
||||
@ -93,15 +93,14 @@ public final class JavaExecutionContext extends AbstractExecutionContext<JavaScr
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Path, Throwable> executeScripts(final Iterable<Path> sourcePaths) throws Exception
|
||||
public Map<Path, Throwable> executeScripts(Iterable<Path> sourcePaths) throws Exception
|
||||
{
|
||||
final DiagnosticCollector<JavaFileObject> fileManagerDiagnostics = new DiagnosticCollector<>();
|
||||
final DiagnosticCollector<JavaFileObject> compilationDiagnostics = new DiagnosticCollector<>();
|
||||
|
||||
try (final ScriptingFileManager fileManager = new ScriptingFileManager(getScriptingEngine().getCompiler().getStandardFileManager(fileManagerDiagnostics, null, StandardCharsets.UTF_8)))
|
||||
{
|
||||
final LinkedList<String> options = new LinkedList<>();
|
||||
|
||||
final List<String> 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<JavaScr
|
||||
|
||||
final Map<Path, Throwable> executionFailures = new LinkedHashMap<>();
|
||||
final Iterable<ScriptingOutputFileObject> 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<JavaScr
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry<Path, Throwable> executeScript(final Path sourcePath) throws Exception
|
||||
public Entry<Path, Throwable> executeScript(Path sourcePath) throws Exception
|
||||
{
|
||||
final Map<Path, Throwable> executionFailures = executeScripts(Arrays.asList(sourcePath));
|
||||
if (!executionFailures.isEmpty())
|
||||
|
@ -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;
|
||||
}
|
||||
@ -234,8 +239,8 @@ public final class FloodProtectorAction
|
||||
throw new IllegalStateException("Missing state on switch");
|
||||
}
|
||||
}
|
||||
Arrays.stream(lines).forEach(output::append);
|
||||
|
||||
StringUtil.append(output, lines);
|
||||
_log.warning(output.toString());
|
||||
}
|
||||
}
|
@ -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, "<table width=", String.valueOf(width), " cellpadding=0 cellspacing=0><tr><td background=\"" + backgroundImage + "\">");
|
||||
StringUtil.append(sb, "<img src=\"" + image + "\" width=", String.valueOf((long) (((double) current / max) * width)), " height=", String.valueOf(imageHeight), ">");
|
||||
StringUtil.append(sb, "</td></tr><tr><td align=center><table cellpadding=0 cellspacing=", String.valueOf(top), "><tr><td>");
|
||||
sb.append("<table width=");
|
||||
sb.append(width);
|
||||
sb.append(" cellpadding=0 cellspacing=0>");
|
||||
sb.append("<tr>");
|
||||
sb.append("<td background=\"");
|
||||
sb.append(backgroundImage);
|
||||
sb.append("\">");
|
||||
sb.append("<img src=\"");
|
||||
sb.append(image);
|
||||
sb.append("\" width=");
|
||||
sb.append((long) (((double) current / max) * width));
|
||||
sb.append(" height=");
|
||||
sb.append(imageHeight);
|
||||
sb.append(">");
|
||||
sb.append("</td>");
|
||||
sb.append("</tr>");
|
||||
sb.append("<tr>");
|
||||
sb.append("<td align=center>");
|
||||
sb.append("<table cellpadding=0 cellspacing=");
|
||||
sb.append(top);
|
||||
sb.append(">");
|
||||
sb.append("<tr>");
|
||||
sb.append("<td>");
|
||||
if (displayAsPercentage)
|
||||
{
|
||||
StringUtil.append(sb, "<table cellpadding=0 cellspacing=2><tr><td>", String.format("%.2f%%", ((double) current / max) * 100), "</td></tr></table>");
|
||||
sb.append("<table cellpadding=0 cellspacing=2>");
|
||||
sb.append("<tr><td>");
|
||||
sb.append(String.format("%.2f%%", ((double) current / max) * 100));
|
||||
sb.append("</td></tr>");
|
||||
sb.append("</table>");
|
||||
}
|
||||
else
|
||||
{
|
||||
final String tdWidth = String.valueOf((width - 10) / 2);
|
||||
StringUtil.append(sb, "<table cellpadding=0 cellspacing=0><tr><td width=" + tdWidth + " align=right>", String.valueOf(current), "</td>");
|
||||
StringUtil.append(sb, "<td width=10 align=center>/</td><td width=" + tdWidth + ">", String.valueOf(max), "</td></tr></table>");
|
||||
int tdWidth = (width - 10) / 2;
|
||||
sb.append("<table cellpadding=0 cellspacing=0>");
|
||||
sb.append("<tr>");
|
||||
sb.append("<td width=");
|
||||
sb.append(tdWidth);
|
||||
sb.append(" align=right>");
|
||||
sb.append(current);
|
||||
sb.append("</td>");
|
||||
sb.append("<td width=10 align=center>/</td>");
|
||||
sb.append("<td width=");
|
||||
sb.append(tdWidth);
|
||||
sb.append(">");
|
||||
sb.append(max);
|
||||
sb.append("</td>");
|
||||
sb.append("</tr>");
|
||||
sb.append("</table>");
|
||||
}
|
||||
StringUtil.append(sb, "</td></tr></table></td></tr></table>");
|
||||
sb.append("</td>");
|
||||
sb.append("</tr>");
|
||||
sb.append("</table>");
|
||||
sb.append("</td>");
|
||||
sb.append("</tr>");
|
||||
sb.append("</table>");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.util;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
|
||||
/**
|
||||
* String utilities optimized for the best performance.<br>
|
||||
* <h1>How to Use It</h1>
|
||||
* <h2>concat() or append()</h2> If concatenating strings<br>
|
||||
* in single call, use StringUtil.concat(), otherwise use StringUtil.append()<br>
|
||||
* and its variants.<br>
|
||||
* <br>
|
||||
* <h2>Minimum Calls</h2><br>
|
||||
* Bad:
|
||||
*
|
||||
* <pre>
|
||||
* final StringBuilder sbString = new StringBuilder();
|
||||
* StringUtil.append(sbString, "text 1", String.valueOf(npcId));
|
||||
* StringUtil.append("text 2");
|
||||
* </pre>
|
||||
*
|
||||
* Good:
|
||||
*
|
||||
* <pre>
|
||||
* final StringBuilder sbString = new StringBuilder();
|
||||
* StringUtil.append(sbString, "text 1", String.valueOf(npcId), "text 2");
|
||||
* </pre>
|
||||
*
|
||||
* Why?<br/>
|
||||
* Because the less calls you do, the less memory re-allocations have to be done<br>
|
||||
* so the whole text fits into the memory and less array copy tasks has to be<br>
|
||||
* performed. So if using less calls, less memory is used and string concatenation is faster.<br>
|
||||
* <br>
|
||||
* <h2>Size Hints for Loops</h2><br>
|
||||
* Bad:
|
||||
*
|
||||
* <pre>
|
||||
* 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");
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* Good:
|
||||
*
|
||||
* <pre>
|
||||
* 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");
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* Why?<br/>
|
||||
* 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.<br/>
|
||||
* In case there is no text appended before the cycle, just use <code>new
|
||||
* StringBuilder(1300)</code>.<br>
|
||||
* <br>
|
||||
* <h2>Concatenation and Constants</h2><br>
|
||||
* Bad:
|
||||
*
|
||||
* <pre>
|
||||
* StringUtil.concat("text 1 ", "text 2", String.valueOf(npcId));
|
||||
* </pre>
|
||||
*
|
||||
* Good:
|
||||
*
|
||||
* <pre>
|
||||
* StringUtil.concat("text 1 " + "text 2", String.valueOf(npcId));
|
||||
* </pre>
|
||||
*
|
||||
* or
|
||||
*
|
||||
* <pre>
|
||||
* StringUtil.concat("text 1 text 2", String.valueOf(npcId));
|
||||
* </pre>
|
||||
*
|
||||
* Why?<br/>
|
||||
* 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.<br>
|
||||
* <h2>Concatenation and Constant Variables</h2> Bad:
|
||||
*
|
||||
* <pre>
|
||||
* String glue = "some glue";
|
||||
* StringUtil.concat("text 1", glue, "text 2", glue, String.valueOf(npcId));
|
||||
* </pre>
|
||||
*
|
||||
* Good:
|
||||
*
|
||||
* <pre>
|
||||
* final String glue = "some glue";
|
||||
* StringUtil.concat("text 1" + glue + "text2" + glue, String.valueOf(npcId));
|
||||
* </pre>
|
||||
*
|
||||
* Why? Because when using <code>final</code> keyword, the <code>glue</code> 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 <code>final String objectIdString =
|
||||
* String.valueOf(getObjectId)</code>.<br>
|
||||
* <br>
|
||||
* <h2>StringBuilder Reuse</h2><br>
|
||||
* Bad:
|
||||
*
|
||||
* <pre>
|
||||
* 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");
|
||||
* </pre>
|
||||
*
|
||||
* Good:
|
||||
*
|
||||
* <pre>
|
||||
* 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");
|
||||
* </pre>
|
||||
*
|
||||
* Why?</br>
|
||||
* 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.
|
||||
* <h2>Primitives to Strings</h2> To convert primitives to string, use String.valueOf().<br>
|
||||
* <br>
|
||||
* <h2>How much faster is it?</h2><br>
|
||||
* 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.<br>
|
||||
*
|
||||
* <pre>
|
||||
* 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
|
||||
* </pre>
|
||||
*
|
||||
* @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 <code>sizeHint</code>, unless total length of strings is greater than <code>sizeHint</code>.
|
||||
* @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<String> 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();
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user