Jump to content
  • 0

Adapt: Community Board Interlude


Question

Posted

Hello beautiful :dance:
im new here :sad:

have some problems  with adapting Community Board (BlesseNtumble)

one of the many thing that making its very hard to adapt
somebody know what is it (_L0) 
Thank u 4 ur time :aproove-smile:

if(con == null) goto _L0; else goto _L0

10 answers to this question

Recommended Posts

  • 0
Posted

You have decompiled code.

Quote

GOTO _LO

 

it's jump to LABEL. Decompilers have no imagine for reproducing back the correct some breakers inside cycles. Possible the Java equivalent is:

if (conn == null)
	continue;

Ofc for FOR cycle inside.

  • 0
Posted
On 10/2/2020 at 5:11 PM, Dreamerdream said:

Acis 

Here is my gatekeeper on my pack, try this one. 

It was copy pasted and adapted from other pack it's not the best quality but it works, you can improve it.

package net.sf.l2j.gameserver.communitybbs.Manager;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.cache.HtmCache;
import net.sf.l2j.gameserver.communitybbs.tasks.PlayerStatsUpdateTask;
import net.sf.l2j.gameserver.data.xml.TeleportLocationData;
import net.sf.l2j.gameserver.model.actor.instance.Player;
import net.sf.l2j.gameserver.model.location.TeleportLocation;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;

/**
 * 
 * @author Designatix
 *
 */
public class GatekeeperBBSManager extends BaseBBSManager
{
	public void parsecmd(String command, Player activeChar)
	{
		if (command.startsWith("_bbsgatekeeper"))
		{
			String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/1.htm");
			content = content.replace("%CharName%", String.valueOf(activeChar.getName()));
			separateAndSend(content, activeChar);
			
			StringTokenizer st = new StringTokenizer(command, ";");
			st.nextToken();
			String secondCommand = st.nextToken();
			if (secondCommand.equals("giran")) 
			{
				showGiranTeleports(activeChar);
			}
			else if (secondCommand.equals("aden")) 
			{
				showAdenTeleports(activeChar);
			}
			else if (secondCommand.equals("dion")) 
			{
				showDionTeleports(activeChar);
			}
		    else if (secondCommand.equals("gludio")) 
		    {
		    	showGludioTeleports(activeChar);
		    }
		    else if (secondCommand.equals("heine")) 
		    {
		    	showHeineTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("oren")) 
		    {
		        showOrenTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("rune")) 
		    {
		        showRuneTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("goddard")) 
		    {
		        showGoddardTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("schuttgart")) 
		    {
		        showSchuttgartTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("talkingisland")) 
		    {
		        showTalkingIslandTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("elvenvillage")) 
		    {
		        showElvenTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("darkelvenvillage")) 
		    {
		        showDarkElvenTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("dwarvenvillage")) 
		    {
		        showDwarvenTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("orcvillage")) 
		    {
		        showOrcTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("huntersvillage")) 
		    {
		        showHuntersTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("gludin")) 
		    {
		        showGludinTeleports(activeChar);		
		    }
		}
		
		else
		{
			super.parseCmd(command, activeChar);
		}
	}
      
	public static void doTeleport(Player player, int val)
	{
		TeleportLocation list = TeleportLocationData.getInstance().getTeleportLocation(val);
		if (list != null)
		{
			if (player.isAlikeDead())
				return;
			
			// Retrieve price list. Potentially cut it by 2 depending of current date.
			int price = list.getPrice();
			
			// Delete related items, and if successful teleport the player to the location.
			if (player.destroyItemByItemId("Teleport ", (list.isNoble()) ? 6651 : 57, price, player, true))
				player.teleToLocation(list, 20);
		}
		else
			_log.warning("No teleport destination with id:" + val);
		
		player.sendPacket(ActionFailed.STATIC_PACKET);
	}
	
	private static void showGiranTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/giran.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showAdenTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/aden.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showDionTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/dion.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showGludioTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/gludio.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showHeineTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/heine.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showOrenTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/oren.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showRuneTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/rune.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showGoddardTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/goddard.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showSchuttgartTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/schuttgart.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showTalkingIslandTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/talkingisland.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showElvenTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/elven.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showDarkElvenTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/darkelven.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showDwarvenTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/dwarven.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showOrcTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/orc.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showHuntersTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/hunters.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showGludinTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/gludin.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}
	
	@Override
	protected String getFolder()
	{
		return "stats/";
	}
	
	public static GatekeeperBBSManager getInstance()
	{
		return SingletonHolder.INSTANCE;
	}
      
	private static class SingletonHolder
	{
		protected static final GatekeeperBBSManager INSTANCE = new GatekeeperBBSManager();
	}
}

 

  • 0
Posted
On 10/3/2020 at 7:16 PM, Psyancy said:

Here is my gatekeeper on my pack, try this one. 

It was copy pasted and adapted from other pack it's not the best quality but it works, you can improve it.


package net.sf.l2j.gameserver.communitybbs.Manager;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.cache.HtmCache;
import net.sf.l2j.gameserver.communitybbs.tasks.PlayerStatsUpdateTask;
import net.sf.l2j.gameserver.data.xml.TeleportLocationData;
import net.sf.l2j.gameserver.model.actor.instance.Player;
import net.sf.l2j.gameserver.model.location.TeleportLocation;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;

/**
 * 
 * @author Designatix
 *
 */
public class GatekeeperBBSManager extends BaseBBSManager
{
	public void parsecmd(String command, Player activeChar)
	{
		if (command.startsWith("_bbsgatekeeper"))
		{
			String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/1.htm");
			content = content.replace("%CharName%", String.valueOf(activeChar.getName()));
			separateAndSend(content, activeChar);
			
			StringTokenizer st = new StringTokenizer(command, ";");
			st.nextToken();
			String secondCommand = st.nextToken();
			if (secondCommand.equals("giran")) 
			{
				showGiranTeleports(activeChar);
			}
			else if (secondCommand.equals("aden")) 
			{
				showAdenTeleports(activeChar);
			}
			else if (secondCommand.equals("dion")) 
			{
				showDionTeleports(activeChar);
			}
		    else if (secondCommand.equals("gludio")) 
		    {
		    	showGludioTeleports(activeChar);
		    }
		    else if (secondCommand.equals("heine")) 
		    {
		    	showHeineTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("oren")) 
		    {
		        showOrenTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("rune")) 
		    {
		        showRuneTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("goddard")) 
		    {
		        showGoddardTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("schuttgart")) 
		    {
		        showSchuttgartTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("talkingisland")) 
		    {
		        showTalkingIslandTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("elvenvillage")) 
		    {
		        showElvenTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("darkelvenvillage")) 
		    {
		        showDarkElvenTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("dwarvenvillage")) 
		    {
		        showDwarvenTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("orcvillage")) 
		    {
		        showOrcTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("huntersvillage")) 
		    {
		        showHuntersTeleports(activeChar);		
		    }
		    else if (secondCommand.equals("gludin")) 
		    {
		        showGludinTeleports(activeChar);		
		    }
		}
		
		else
		{
			super.parseCmd(command, activeChar);
		}
	}
      
	public static void doTeleport(Player player, int val)
	{
		TeleportLocation list = TeleportLocationData.getInstance().getTeleportLocation(val);
		if (list != null)
		{
			if (player.isAlikeDead())
				return;
			
			// Retrieve price list. Potentially cut it by 2 depending of current date.
			int price = list.getPrice();
			
			// Delete related items, and if successful teleport the player to the location.
			if (player.destroyItemByItemId("Teleport ", (list.isNoble()) ? 6651 : 57, price, player, true))
				player.teleToLocation(list, 20);
		}
		else
			_log.warning("No teleport destination with id:" + val);
		
		player.sendPacket(ActionFailed.STATIC_PACKET);
	}
	
	private static void showGiranTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/giran.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showAdenTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/aden.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showDionTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/dion.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showGludioTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/gludio.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showHeineTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/heine.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showOrenTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/oren.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showRuneTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/rune.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showGoddardTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/goddard.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showSchuttgartTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/schuttgart.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showTalkingIslandTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/talkingisland.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showElvenTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/elven.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showDarkElvenTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/darkelven.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showDwarvenTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/dwarven.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showOrcTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/orc.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showHuntersTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/hunters.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}

	private static void showGludinTeleports(Player activeChar)
	{
		String content = HtmCache.getInstance().getHtm("data/html/CommunityBoard/gatekeeper/gludin.htm");		
		
	    content = content.replaceAll("%toppvp%", PlayerStatsUpdateTask.pvpList());
	    content = content.replace("%lastUpdate%", PlayerStatsUpdateTask.getLastUpdate());
	    separateAndSend(content, activeChar);		
	}
	
	@Override
	protected String getFolder()
	{
		return "stats/";
	}
	
	public static GatekeeperBBSManager getInstance()
	{
		return SingletonHolder.INSTANCE;
	}
      
	private static class SingletonHolder
	{
		protected static final GatekeeperBBSManager INSTANCE = new GatekeeperBBSManager();
	}
}

 

Thank You m8 
 L2Teleportloction and TeleportLocationTable  changed the name right ? can you please tell me 
Thank 

private static void doTeleport(Player player, int val) {
        TeleportLocation list = TeleportLocationData.getInstance().getTemplate(val);
        if (list != null) {
            player.teleToLocation(list.getX(), list.getY(), list.getZ(), true);
        } else {
            System.out.println("No teleport destination with id:" + val);
        }

        player.sendPacket(ActionFailed.STATIC_PACKET);
    }

    public static TeleBBSManager getInstance() {
        return TeleBBSManager.SingletonHolder.INSTANCE;
    }

    private static class SingletonHolder {
        protected static final TeleBBSManager INSTANCE = new TeleBBSManager();

        private SingletonHolder() {
        }
    }
}
  • 0
Posted
9 hours ago, Dreamerdream said:

Thank You m8 
 L2Teleportloction and TeleportLocationTable  changed the name right ? can you please tell me 
Thank 


private static void doTeleport(Player player, int val) {
        TeleportLocation list = TeleportLocationData.getInstance().getTemplate(val);
        if (list != null) {
            player.teleToLocation(list.getX(), list.getY(), list.getZ(), true);
        } else {
            System.out.println("No teleport destination with id:" + val);
        }

        player.sendPacket(ActionFailed.STATIC_PACKET);
    }

    public static TeleBBSManager getInstance() {
        return TeleBBSManager.SingletonHolder.INSTANCE;
    }

    private static class SingletonHolder {
        protected static final TeleBBSManager INSTANCE = new TeleBBSManager();

        private SingletonHolder() {
        }
    }
}

It depends on your source version mate, there are several changes all these years locations changed, names changed.

If you find it hard to find something you can search in acis updates for the word you're looking for, example L2TeleportLocation and you will see the new class that it's added or renamed so you will know where to look.

  • 0
Posted

****UPDATE****
completed all the mistakes 
but the CommunityBoard still don't work 
im feeling the its with the TopBBS manager 

if somebody know what wrong here please let me know

Thanks again 4 ur time 

 

public void parseCmd(String command, Player player) {
      String fileName = "";
      StringTokenizer st;
      String ip;
      String content;
      if (Config.ENABLE_COMMUNITY_BOARD) {
         if (command.equals("_bbstop") || command.equals("_bbshome")) {
            fileName = "data/html/CommunityBoard/Custom/CustomIndex.htm";
         }

         if (command.startsWith("_bbshome;")) {
            st = new StringTokenizer(command, ";");
            st.nextToken();
            ip = st.nextToken();
            fileName = "data/html/CommunityBoard/Custom" + ip + ".htm";
         }

         if (fileName.length() == 0) {
            return;
         }

         content = HtmCache.getInstance().getHtm(fileName);
         ip = "N/A";
         String account = "N/A";

         try {
            String clientInfo = player.getClient().toString();
            account = clientInfo.substring(clientInfo.indexOf("Account: ") + 9, clientInfo.indexOf(" - IP: "));
            ip = clientInfo.substring(clientInfo.indexOf(" - IP: ") + 7, clientInfo.lastIndexOf("]"));
         } catch (Exception var8) {
         }

         if (fileName.equals("data/html/CommunityBoard/Custom/toppvp.htm")) {
         }

         PlayerList pk = new PlayerList(1);
         content = content.replaceAll("%pvplist%", pk.loadPlayerList());
         if (fileName.equals("data/html/CommunityBoard/Custom/castle.htm")) {
         }

         CastleStatus status = new CastleStatus();
         content = content.replaceAll("%castle%", status.loadCastleList());
         if (fileName.equals("data/html/CommunityBoard/Custom/toppk.htm")) {
         }

         pk = new PlayerList(0);
         content = content.replaceAll("%pklist%", pk.loadPlayerList());
         if (fileName.equals("data/html/CommunityBoard/Custom/accinfo.htm")) {
         }

         content = content.replaceAll("%name%", player.getName());
         content = content.replaceAll("%level%", String.valueOf(player.getLevel()));
         content = content.replaceAll("%clan%", String.valueOf(ClanTable.getInstance().getClan(player.getClanId())));
         content = content.replaceAll("%xp%", String.valueOf(player.getExp()));
         content = content.replaceAll("%sp%", String.valueOf(player.getSp()));
         content = content.replaceAll("%class%", player.getTemplate().getClassName());
         content = content.replaceAll("%classid%", String.valueOf(player.getClassId()));
         content = content.replaceAll("%currenthp%", String.valueOf((int)player.getCurrentHp()));
         content = content.replaceAll("%maxhp%", String.valueOf(player.getMaxHp()));
         content = content.replaceAll("%currentmp%", String.valueOf((int)player.getCurrentMp()));
         content = content.replaceAll("%maxmp%", String.valueOf(player.getMaxMp()));
         content = content.replaceAll("%currentcp%", String.valueOf((int)player.getCurrentCp()));
         content = content.replaceAll("%maxcp%", String.valueOf(player.getMaxCp()));
         content = content.replaceAll("%currentload%", String.valueOf(player.getCurrentLoad()));
         content = content.replaceAll("%maxload%", String.valueOf(player.getMaxLoad()));
         content = content.replaceAll("%access%", String.valueOf(player.getAccessLevel().getLevel()));
         content = content.replaceAll("%account%", account);
         content = content.replaceAll("%ip%", ip);
         if (fileName.equals("data/html/CommunityBoard/Custom/topadena.htm")) {
         }

         TopAdena topAdena = new TopAdena();
         content = content.replaceAll("%topadena%", topAdena.loadPlayerList());
         if (fileName.equals("data/html/CommunityBoard/Custom/gms.htm")) {
         }


         content = content.replaceAll("%antharas%", bossStatus(29019));
         content = content.replaceAll("%valakas%", bossStatus(29028));
         content = content.replaceAll("%baium%", bossStatus(29001));
         content = content.replaceAll("%antqueen%", bossStatus(29020));
         content = content.replaceAll("%core%", bossStatus(29006));
         content = content.replaceAll("%zaken%", bossStatus(29022));
         content = content.replaceAll("%frintezza%", bossStatus(29045));
         if (fileName.equals("data/html/CommunityBoard/Custom/repair.htm")) {
         }

         content = content.replaceAll("%acc_chars%", getCharList(player));
         if (fileName.equals("data/html/CommunityBoard/Custom/stats.htm")) {
         }

      } else {
         if (command.equals("_bbstop") || command.equals("_bbshome")) {
            fileName = "data/html/CommunityBoard/Index.htm";
         }

         if (command.startsWith("_bbstop;")) {
            st = new StringTokenizer(command, ";");
            st.nextToken();
            ip = st.nextToken();
            fileName = "data/html/CommunityBoard/" + ip + ".htm";
         }

         if (fileName.length() == 0) {
            return;
         }

         content = HtmCache.getInstance().getHtm(fileName);
         if (content != null) {
            separateAndSend(content, player);
         }
      }

   }

   public void parseWrite(String ar1, String ar2, String ar3, String ar4, String ar5, Player player) {
   }


   private static String bossStatus(int bossId) {
      long delay = GrandBossManager.getInstance().getStatsSet(bossId).getLong("respawn_time");
      return delay <= System.currentTimeMillis() ? "<font color=\"9CC300\">Alive</font>" : "<font color=\"ff0000\">Dead</font>";
   }

   private static String getCharList(Player player) {
      String result = "";
      String repCharAcc = player.getAccountName();
      Connection con = null;

      String var5;
      try {
         con = L2DatabaseFactory.getInstance().getConnection();
         PreparedStatement statement = con.prepareStatement("SELECT char_name FROM characters WHERE account_name=?");
         statement.setString(1, repCharAcc);
         ResultSet rset = statement.executeQuery();

         while(rset.next()) {
            if (player.getName().compareTo(rset.getString(1)) != 0) {
               result = result + rset.getString(1) + ";";
            }
         }

         rset.close();
         statement.close();
         return result;
      } catch (SQLException var9) {
         var9.printStackTrace();
         var5 = result;
      } finally {
         CloseUtil.close(con);
      }

      return var5;
   }

   public static TopBBSManager getInstance() {
      return SingletonHolder.INSTANCE;
   }

   private static class SingletonHolder {
      protected static final TopBBSManager INSTANCE = new TopBBSManager();

      private SingletonHolder() {
      }
   }
}

 

  • 0
Posted

UPDATE
No error but when i trying to open the community Board noting happening 
When i delete The CustomIndex.htm an try to open the CB its giving me and error 
i tried to change the CustomIndex code to the regular code and still nothing happen 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...