Partial sync L2jUnity free release Feb 16th 2015.

This commit is contained in:
MobiusDev
2016-10-23 14:56:34 +00:00
parent 89d5331c99
commit be6443a66a
106 changed files with 1866 additions and 1803 deletions

View File

@@ -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);
}
}
}

View File

@@ -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>&nbsp;>&nbsp;<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>&nbsp;</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>&nbsp;</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>&nbsp;>&nbsp;<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>&nbsp;</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>&nbsp;</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>&nbsp;>&nbsp;<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; : &nbsp;</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; : &nbsp;</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(">", "&gt;").replace("<", "&lt;"), "</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>&nbsp;<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>&nbsp;<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>&nbsp;</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(">", "&gt;");
mes = mes.replace("<", "&lt;");
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>&nbsp;>&nbsp;<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; : &nbsp;</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; : &nbsp;</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>&nbsp;<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>&nbsp;<td><button value = \"&$421;\" action=\"bypass _bbstopics;crea;" + forum.getID() + "\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td>&nbsp;</tr></table></td></tr></table><br><br><br></center></body></html>";
CommunityBoardHandler.separateAndSend(html, activeChar);
}
@Override

View File

@@ -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>&nbsp;>&nbsp;<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>&nbsp;</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>&nbsp;</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>&nbsp;>&nbsp;<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>&nbsp;</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>&nbsp;</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>&nbsp;>&nbsp;<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>&nbsp;>&nbsp;<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);
}

View File

@@ -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;

View File

@@ -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 + ".");

View File

@@ -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)

View File

@@ -36,7 +36,6 @@ import com.l2jmobius.gameserver.enums.ShortcutType;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.interfaces.IRestorable;
import com.l2jmobius.gameserver.network.serverpackets.SendMacroList;
import com.l2jmobius.util.StringUtil;
public class MacroList implements IRestorable
{
@@ -136,10 +135,10 @@ public class MacroList implements IRestorable
final StringBuilder sb = new StringBuilder(300);
for (MacroCmd cmd : macro.getCommands())
{
StringUtil.append(sb, String.valueOf(cmd.getType().ordinal()), ",", String.valueOf(cmd.getD1()), ",", String.valueOf(cmd.getD2()));
sb.append(cmd.getType().ordinal() + "," + cmd.getD1() + "," + cmd.getD2());
if ((cmd.getCmd() != null) && (cmd.getCmd().length() > 0))
{
StringUtil.append(sb, ",", cmd.getCmd());
sb.append("," + cmd.getCmd());
}
sb.append(';');
}

View File

@@ -34,7 +34,6 @@ import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.TutorialCloseHtml;
import com.l2jmobius.gameserver.network.serverpackets.TutorialShowQuestionMark;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
import com.l2jmobius.util.StringUtil;
/**
* This class ...
@@ -295,7 +294,7 @@ public final class L2ClassMasterInstance extends L2MerchantInstance
}
if (validateClassId(currentClassId, cid) && (cid.level() == level))
{
StringUtil.append(menu, "<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>");
}
}
@@ -346,7 +345,7 @@ public final class L2ClassMasterInstance extends L2MerchantInstance
}
if (validateClassId(currentClassId, cid))
{
StringUtil.append(menu, "<a action=\"bypass -h AlternateClassMaster ", 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>");
}
}

View File

@@ -32,7 +32,6 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.util.StringUtil;
public class L2NpcInstance extends L2Npc
{
@@ -112,7 +111,7 @@ public class L2NpcInstance extends L2Npc
if (((L2NpcInstance) npc).getClassesToTeach().isEmpty())
{
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
final String sb = StringUtil.concat("<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;

View File

@@ -287,6 +287,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
import com.l2jmobius.gameserver.network.serverpackets.ExUseSharedGroupItem;
import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoAbnormalVisualEffect;
import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoFishing;
import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
import com.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
import com.l2jmobius.gameserver.network.serverpackets.GameGuardQuery;
@@ -303,6 +304,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ObservationMode;
import com.l2jmobius.gameserver.network.serverpackets.ObservationReturn;
import com.l2jmobius.gameserver.network.serverpackets.PartySmallWindowUpdate;
import com.l2jmobius.gameserver.network.serverpackets.PetInventoryUpdate;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import com.l2jmobius.gameserver.network.serverpackets.PledgeShowMemberListDelete;
import com.l2jmobius.gameserver.network.serverpackets.PledgeShowMemberListUpdate;
import com.l2jmobius.gameserver.network.serverpackets.PrivateStoreListBuy;
@@ -11832,7 +11834,7 @@ public final class L2PcInstance extends L2Playable
_fishx = _x;
_fishy = _y;
_fishz = _z;
// broadcastUserInfo();
// Starts fishing
final int lvl = getRandomFishLvl();
final int grade = getRandomFishGrade();
@@ -11852,9 +11854,9 @@ public final class L2PcInstance extends L2Playable
{
_fish.setFishGroup(-1);
}
// sendMessage("Hook x,y: " + _x + "," + _y + " - Water Z, Player Z:" + _z + ", " + getZ()); // debug line, uncoment to show coordinates used in fishing.
broadcastPacket(new ExFishingStart(this, _fish.getFishGroup(), _x, _y, _z, _lure.isNightLure()));
// sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
sendPacket(new ExUserInfoFishing(this));
sendPacket(new PlaySound(1, "SF_P_01", 0, 0, 0, 0, 0));
startLookingForFishTask();
}

View File

@@ -54,7 +54,6 @@ import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
import com.l2jmobius.util.StringUtil;
/**
* Hero entity.
@@ -464,19 +463,19 @@ public class Hero
{
breakat = i;
final StatsSet diaryEntry = list.get(i);
StringUtil.append(fList, "<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>&nbsp;</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>&nbsp;</td></tr></table>");
fList.append("</td></tr>");
color = !color;
counter++;
if (counter >= perpage)
@@ -552,19 +551,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>&nbsp;&nbsp;" + 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>&nbsp;</td></tr></table>");
StringUtil.append(fList, "</td></tr>");
fList.append("<tr><td width=220><font color=\"LEVEL\">" + fight.getString("start") + "</font>&nbsp;&nbsp;" + 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>&nbsp;</td></tr></table>");
fList.append("</td></tr>");
color = !color;
counter++;
if (counter >= perpage)

View File

@@ -52,7 +52,7 @@ public class Message
private String _receiverName = null;
private final String _subject, _content;
private boolean _unread, _returned;
private MailType _messageType = MailType.REGULAR;
private final MailType _messageType;
private boolean _deletedBySender;
private boolean _deletedByReceiver;
private final long _reqAdena;
@@ -112,6 +112,7 @@ public class Message
_deletedBySender = false;
_deletedByReceiver = false;
_reqAdena = reqAdena;
_messageType = MailType.REGULAR;
}
/*

View File

@@ -55,7 +55,6 @@ import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.util.Rnd;
import com.l2jmobius.util.StringUtil;
/**
* @author HorridoJoho
@@ -540,7 +539,7 @@ public class TvTEvent
return "-";
}
return StringUtil.concat(String.valueOf(itemNum), " ", ItemTable.getInstance().getTemplate(itemId).getName());
return itemNum + " " + ItemTable.getInstance().getTemplate(itemId).getName();
}
/**

View File

@@ -43,7 +43,7 @@ import com.l2jmobius.gameserver.model.items.type.WeaponType;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
import com.l2jmobius.util.StringUtil;
import com.l2jmobius.util.Util;
/**
* This class manages inventory
@@ -1678,7 +1678,7 @@ public abstract class Inventory extends ItemContainer
default:
{
_log.info("Unhandled slot type: " + slot);
_log.info(StringUtil.getTraceString(Thread.currentThread().getStackTrace()));
_log.info(Util.getTraceString(Thread.currentThread().getStackTrace()));
}
}
if (pdollSlot < 0)

View File

@@ -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))
{

View File

@@ -23,7 +23,6 @@ import com.l2jmobius.gameserver.model.L2ExtractableProduct;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
import com.l2jmobius.gameserver.model.items.type.EtcItemType;
import com.l2jmobius.util.StringUtil;
/**
* This class is dedicated to the management of EtcItem.
@@ -96,7 +95,7 @@ public final class L2EtcItem extends L2Item
final String[] data = part.split(",");
if ((data.length != 4) && (data.length != 6))
{
_log.info(StringUtil.concat("> Couldnt parse ", part, " in capsuled_items! item ", toString()));
_log.info("> Couldnt parse " + part + " in capsuled_items! item " + this);
continue;
}
final int itemId = Integer.parseInt(data[0]);
@@ -104,7 +103,7 @@ public final class L2EtcItem extends L2Item
final int max = Integer.parseInt(data[2]);
if (max < min)
{
_log.info(StringUtil.concat("> Max amount < Min amount in ", part, ", item ", toString()));
_log.info("> Max amount < Min amount in " + part + ", item " + this);
continue;
}
final double chance = Double.parseDouble(data[3]);
@@ -116,7 +115,7 @@ public final class L2EtcItem extends L2Item
maxEnchant = Integer.parseInt(data[5]);
if (maxEnchant < minEnchant)
{
_log.info(StringUtil.concat("> Max enchant < Min enchant in ", part, ", item ", toString()));
_log.info("> Max enchant < Min enchant in " + part + ", item " + this);
continue;
}
}

View File

@@ -48,7 +48,6 @@ import com.l2jmobius.gameserver.model.stats.functions.AbstractFunction;
import com.l2jmobius.gameserver.model.stats.functions.FuncTemplate;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.util.StringUtil;
/**
* This class contains all informations concerning the item (weapon, armor, etc).<BR>
@@ -66,7 +65,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
public static final int TYPE1_WEAPON_RING_EARRING_NECKLACE = 0;
public static final int TYPE1_SHIELD_ARMOR = 1;
public static final int TYPE1_ITEM_QUESTITEM_ADENA = 4;
public static final int TYPE2_WEAPON = 0;
public static final int TYPE2_SHIELD_ARMOR = 1;
public static final int TYPE2_ACCESSORY = 2;
@@ -112,43 +111,43 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
public static final int SLOT_MULTI_ALLWEAPON = SLOT_LR_HAND | SLOT_R_HAND;
private int _itemId;
private int _displayId;
private String _name;
private String _additionalName;
private String _icon;
private int _weight;
private boolean _stackable;
private MaterialType _materialType;
private CrystalType _crystalType;
private int _equipReuseDelay;
private int _duration;
private int _time;
private int _autoDestroyTime;
private int _bodyPart;
private int _referencePrice;
private int _crystalCount;
private boolean _sellable;
private boolean _dropable;
private boolean _destroyable;
private boolean _tradeable;
private boolean _depositable;
private boolean _auctionable;
private int _enchantable;
private boolean _elementable;
private boolean _questItem;
private boolean _freightable;
private boolean _allow_self_resurrection;
private boolean _is_oly_restricted;
private boolean _for_npc;
private boolean _common;
private boolean _heroItem;
private boolean _pvpItem;
private boolean _immediate_effect;
private boolean _ex_immediate_effect;
private int _defaultEnchantLevel;
private ActionType _defaultAction;
private boolean _isBlessedItem;
private int _itemId;
private int _displayId;
private String _name;
private String _additionalName;
private String _icon;
private int _weight;
private boolean _stackable;
private MaterialType _materialType;
private CrystalType _crystalType;
private int _equipReuseDelay;
private int _duration;
private int _time;
private int _autoDestroyTime;
private int _bodyPart;
private int _referencePrice;
private int _crystalCount;
private boolean _sellable;
private boolean _dropable;
private boolean _destroyable;
private boolean _tradeable;
private boolean _depositable;
private boolean _auctionable;
private int _enchantable;
private boolean _elementable;
private boolean _questItem;
private boolean _freightable;
private boolean _allow_self_resurrection;
private boolean _is_oly_restricted;
private boolean _for_npc;
private boolean _common;
private boolean _heroItem;
private boolean _pvpItem;
private boolean _immediate_effect;
private boolean _ex_immediate_effect;
private int _defaultEnchantLevel;
private ActionType _defaultAction;
private boolean _isBlessedItem;
protected int _type1; // needed for item list (inventory)
protected int _type2; // different lists for armor, weapon, etc
@@ -159,13 +158,13 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
private SkillHolder _unequipSkill = null;
private SkillHolder _equipSkill = null;
private int _useSkillDisTime;
private int _reuseDelay;
private int _sharedReuseGroup;
private int _useSkillDisTime;
private int _reuseDelay;
private int _sharedReuseGroup;
private CommissionItemType _commissionItemType;
private int _compoundItem;
private float _compoundChance;
private CommissionItemType _commissionItemType;
private int _compoundItem;
private float _compoundChance;
/**
* Constructor of the L2Item that fill class variables.<BR>
@@ -240,13 +239,13 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
if (id == 0)
{
_log.info(StringUtil.concat("Ignoring item_skill(", element, ") for item ", toString(), ". Skill id is 0!"));
_log.info("Ignoring item_skill(" + element + ") for item " + this + ". Skill id is 0!");
continue;
}
if (level == 0)
{
_log.info(StringUtil.concat("Ignoring item_skill(", element, ") for item ", toString(), ". Skill level is 0!"));
_log.info("Ignoring item_skill(" + element + ") for item " + this + ". Skill level is 0!");
continue;
}
@@ -255,7 +254,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
}
catch (Exception e)
{
_log.warning(StringUtil.concat("Failed to parse item_skill(", element, ") for item ", toString(), "! Format: SkillId0-SkillLevel0[;SkillIdN-SkillLevelN]"));
_log.warning("Failed to parse item_skill(" + element + ") for item " + this + "! Format: SkillId0-SkillLevel0[;SkillIdN-SkillLevelN]");
}
}
@@ -284,7 +283,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
catch (Exception nfe)
{
// Incorrect syntax, don't add new skill
_log.info(StringUtil.concat("Couldnt parse ", skills, " in weapon unequip skills! item ", toString()));
_log.info("Couldnt parse " + skills + " in weapon unequip skills! item " + this);
}
if ((id > 0) && (level > 0))
{
@@ -309,7 +308,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
catch (Exception nfe)
{
// Incorrect syntax, don't add new skill
_log.info(StringUtil.concat("Couldnt parse ", skills, " in item equip skill! item ", toString()));
_log.info("Couldnt parse " + skills + " in item equip skill! item " + this);
}
if ((id > 0) && (level > 0))
{

View File

@@ -33,26 +33,25 @@ import com.l2jmobius.gameserver.model.stats.Formulas;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.Util;
import com.l2jmobius.util.StringUtil;
/**
* This class is dedicated to the management of weapons.
*/
public final class L2Weapon extends L2Item
{
private WeaponType _type;
private boolean _isMagicWeapon;
private int _rndDam;
private int _soulShotCount;
private int _spiritShotCount;
private int _mpConsume;
private int _baseAttackRange;
private int _baseAttackAngle;
private WeaponType _type;
private boolean _isMagicWeapon;
private int _rndDam;
private int _soulShotCount;
private int _spiritShotCount;
private int _mpConsume;
private int _baseAttackRange;
private int _baseAttackAngle;
/**
* Skill that activates when item is enchanted +4 (for duals).
*/
private SkillHolder _enchant4Skill = null;
private int _changeWeaponId;
private int _changeWeaponId;
// Attached skills for Special Abilities
private SkillHolder _skillsOnMagic;
@@ -60,15 +59,15 @@ public final class L2Weapon extends L2Item
private SkillHolder _skillsOnCrit;
private Condition _skillsOnCritCondition = null;
private int _reducedSoulshot;
private int _reducedSoulshotChance;
private int _reducedSoulshot;
private int _reducedSoulshotChance;
private int _reducedMpConsume;
private int _reducedMpConsumeChance;
private int _reducedMpConsume;
private int _reducedMpConsumeChance;
private boolean _isForceEquip;
private boolean _isAttackWeapon;
private boolean _useWeaponSkillsOnly;
private boolean _isForceEquip;
private boolean _isAttackWeapon;
private boolean _useWeaponSkillsOnly;
/**
* Constructor for Weapon.
@@ -120,7 +119,7 @@ public final class L2Weapon extends L2Item
catch (Exception nfe)
{
// Incorrect syntax, dont add new skill
_log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon enchant skills! item ", toString()));
_log.info("> Couldnt parse " + skill + " in weapon enchant skills! item " + this);
}
if ((id > 0) && (level > 0))
{
@@ -146,7 +145,7 @@ public final class L2Weapon extends L2Item
catch (Exception nfe)
{
// Incorrect syntax, don't add new skill
_log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon onmagic skills! item ", toString()));
_log.info("> Couldnt parse " + skill + " in weapon onmagic skills! item " + this);
}
if ((id > 0) && (level > 0) && (chance > 0))
{
@@ -173,7 +172,7 @@ public final class L2Weapon extends L2Item
catch (Exception nfe)
{
// Incorrect syntax, don't add new skill
_log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon oncrit skills! item ", toString()));
_log.info("> Couldnt parse " + skill + " in weapon oncrit skills! item " + this);
}
if ((id > 0) && (level > 0) && (chance > 0))
{

View File

@@ -533,7 +533,11 @@ public final class QuestState
*/
public int getCond()
{
return isStarted() ? getInt("cond") : 0;
if (isStarted())
{
return getInt("cond");
}
return 0;
}
/**
@@ -583,7 +587,11 @@ public final class QuestState
*/
public int getMemoState()
{
return isStarted() ? getInt("memoState") : 0;
if (isStarted())
{
return getInt("memoState");
}
return 0;
}
public boolean isMemoState(int memoState)
@@ -598,7 +606,11 @@ public final class QuestState
*/
public int getMemoStateEx(int slot)
{
return isStarted() ? getInt("memoStateEx" + slot) : 0;
if (isStarted())
{
return getInt("memoStateEx" + slot);
}
return 0;
}
/**

View File

@@ -375,6 +375,8 @@ public enum AbnormalType
ELEMENTAL_RESISTANCE_ISS,
HOLY_ATTACK_RESISTANCE_ISS,
MENTAL_ATTACK_RESISTANCE_ISS,
CRIPPLING_ATTACK,
SHADOW_BLADE,
SIGEL_AURA,
FEOH_STANCE,
YUL_STANCE,

View File

@@ -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]);
}
}
}

View File

@@ -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

View File

@@ -38,7 +38,6 @@ import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jmobius.gameserver.network.serverpackets.ItemList;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.util.StringUtil;
/**
* @author Migi, DS
@@ -316,7 +315,7 @@ public final class RequestSendPost extends L2GameClientPacket
}
final StringBuilder recv = new StringBuilder(32);
StringUtil.append(recv, msg.getReceiverName(), "[", String.valueOf(msg.getReceiverId()), "]");
recv.append(msg.getReceiverName() + "[" + msg.getReceiverId() + "]");
final String receiver = recv.toString();
// Proceed to the transfer

View File

@@ -0,0 +1,44 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.network.serverpackets;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
/**
* @author Sdw
*/
public class ExUserInfoFishing extends L2GameServerPacket
{
private final L2PcInstance _activeChar;
public ExUserInfoFishing(L2PcInstance activeChar)
{
_activeChar = activeChar;
}
@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0x159);
writeD(_activeChar.getObjectId());
writeC(_activeChar.isFishing() ? 1 : 0);
writeD(_activeChar.getFishx());
writeD(_activeChar.getFishy());
writeD(_activeChar.getFishz());
}
}

View File

@@ -18,8 +18,6 @@ package com.l2jmobius.gameserver.network.serverpackets;
import java.util.List;
import com.l2jmobius.util.StringUtil;
public class ShowBoard extends L2GameServerPacket
{
private final String _content;
@@ -41,7 +39,7 @@ public class ShowBoard extends L2GameServerPacket
public ShowBoard(List<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");

View File

@@ -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;
}

View File

@@ -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())

View File

@@ -16,6 +16,7 @@
*/
package com.l2jmobius.gameserver.util;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -27,7 +28,6 @@ import com.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import com.l2jmobius.gameserver.model.punishment.PunishmentTask;
import com.l2jmobius.gameserver.model.punishment.PunishmentType;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.util.StringUtil;
/**
* Flood protector implementation.
@@ -189,7 +189,9 @@ public final class FloodProtectorAction
private void log(String... lines)
{
final StringBuilder output = StringUtil.startAppend(100, _config.FLOOD_PROTECTOR_TYPE, ": ");
final StringBuilder output = new StringBuilder(100);
output.append(_config.FLOOD_PROTECTOR_TYPE);
output.append(": ");
String address = null;
try
{
@@ -208,8 +210,10 @@ public final class FloodProtectorAction
{
if (_client.getActiveChar() != null)
{
StringUtil.append(output, _client.getActiveChar().getName());
StringUtil.append(output, "(", String.valueOf(_client.getActiveChar().getObjectId()), ") ");
output.append(_client.getActiveChar().getName());
output.append("(");
output.append(_client.getActiveChar().getObjectId());
output.append(") ");
}
break;
}
@@ -217,7 +221,8 @@ public final class FloodProtectorAction
{
if (_client.getAccountName() != null)
{
StringUtil.append(output, _client.getAccountName(), " ");
output.append(_client.getAccountName());
output.append(" ");
}
break;
}
@@ -225,7 +230,7 @@ public final class FloodProtectorAction
{
if (address != null)
{
StringUtil.append(output, address);
output.append(address);
}
break;
}
@@ -235,7 +240,8 @@ public final class FloodProtectorAction
}
}
StringUtil.append(output, lines);
Arrays.stream(lines).forEach(output::append);
_log.warning(output.toString());
}
}

View File

@@ -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();
}