@Override
public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar)
{
if(ar1.equals("crea"))
{
Forum f = ForumsBBSManager.getInstance().getForumByID(Integer.parseInt(ar2));
if(f == null)
{
ShowBoard sb = new ShowBoard("<html><body><br><br><center>the forum: " + ar2 + " is not implemented yet</center><br><br></body></html>", "101");
activeChar.sendPacket(sb);
sb = null;
activeChar.sendPacket(new ShowBoard(null, "102"));
activeChar.sendPacket(new ShowBoard(null, "103"));
}
else
{
f.vload();
Topic t = new Topic(Topic.ConstructorType.CREATE, TopicBBSManager.getInstance().getMaxID(f) + 1, Integer.parseInt(ar2), ar5, Calendar.getInstance().getTimeInMillis(), activeChar.getName(), activeChar.getObjectId(), Topic.MEMO, 0);
f.addtopic(t);
TopicBBSManager.getInstance().setMaxID(t.getID(), f);
Post p = new Post(activeChar.getName(), activeChar.getObjectId(), Calendar.getInstance().getTimeInMillis(), t.getID(), f.getID(), ar4);
PostBBSManager.getInstance().addPostByTopic(p, t);
parsecmd("_bbsmemo", activeChar);
t = null;
p = null;
}
f = null;
}
else if(ar1.equals("del"))
{
Forum f = ForumsBBSManager.getInstance().getForumByID(Integer.parseInt(ar2));
if(f == null)
{
ShowBoard sb = new ShowBoard("<html><body><br><br><center>the forum: " + ar2 + " does not exist !</center><br><br></body></html>", "101");
activeChar.sendPacket(sb);
sb = null;
activeChar.sendPacket(new ShowBoard(null, "102"));
activeChar.sendPacket(new ShowBoard(null, "103"));
}
else
{
Topic t = f.gettopic(Integer.parseInt(ar3));
if(t == null)
{
ShowBoard sb = new ShowBoard("<html><body><br><br><center>the topic: " + ar3 + " does not exist !</center><br><br></body></html>", "101");
activeChar.sendPacket(sb);
sb = null;