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 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Somebody already shared something similar in mmodev, you can "steal" some already missing stuff!
    • Mobius project got its own forum page and website, consider to use those to speak about it. I know it's a new project and you need some visibility, but it's not the way to handle it.     Ty for the advice.
    • ⭐ 100% Safe on your personal Gmail: Zero VPN needed, worldwide access, and backed by 24/7 customer replacement support.     FINAL CALL: Google is Shutting This Down After October 2026! Google will NEVER bring back this window of opportunity again. Once this month ends, this massive backdoor upgrade is gone permanently!  BUY 2, GET 1 FREE IS STILL LIVE! Stock up now for yourself, your family, your business, and your friends! Think about it: Every single person you know uses a Gmail account, and everyone is running out of storage. Don't let your loved ones get trapped paying $20–$30 every single month when you can set them up with 5TB Cloud Storage + Gemini Advanced (12–18 Months) right now for only $15! Why Buy Bulk Activations Today? Instant Gift Value: Perfect lifetime-style gift for clients, family, or team members. 100% Private & Safe: Activates on personal Gmails—zero passwords or logins required. Global Access: Works worldwide with zero VPN hassles. Instant Automated Delivery: Receive your activation links in seconds 24/7! ‍ Time is running out fast—secure your extra free licenses before the October deadline hits! Order Your Bundle Now on the Website
    • Version 0.8.0 - Export to Blender. Map tile transfer. Main/Classic support. New shadows   Download   Location export to Blender   Export works both from the main menu and inside a loaded world.   - Export location… saves one or more tiles (up to 25) into one glTF file (.glb) with textures. The file holds:   - the terrain, with all its layers baked into one texture of 2048, 4096 or 8192 px;   - the level geometry, static meshes, doors and, if you want, the grass. - Neighbouring tiles meet without gaps. Shared textures are written only once. - Water looks like the viewer's realistic water. It is smooth, with ripples, and its colour depends on the depth: turquoise over sand, dark in deep places. - Scale: 1 client unit = 4 cm, so people are 1.8 m tall. - A part exports a square of 200–1300 m instead of the whole tile. - Place NPCs from npcpos places the NPCs from the server's npcpos.txt. For each kind of NPC it writes a separate file with its skeleton and animations. - Time of day takes the client's sun, light, fog and sky (clouds, sun, moon) for the chosen hour.   NPC and player character export   - Export NPC… finds an NPC by name, title, id or mesh. It saves the NPC as glTF with its skeleton and all its animations: idle, walk, run, attacks, death and more. - NPCs built from player race parts, such as guards in armour, are exported too, with their weapons and shields. - Player character mode makes a character of any race in the armour and weapons you choose.   Open in Blender   - Every export comes with the open-in-blender.py script. If Blender is installed, an "Open in Blender" button appears after the export. - A character opens with its textures at once: the camera looks at its face, the idle animation plays, the bones are hidden, and the animations loop. - Locations and characters are lit by their own sun and sky, with shadows. - Each tile and each of its parts (terrain, meshes, grass) is in its own collection, so one checkbox hides it.   Copy, move and swap map tiles   - In Copy, move or swap tiles… you pick the source tile and a place on the map. Cruma shifts all the coordinates in the map. - The geodata region and the spawns from npcpos.txt can move along with the tile. A tile can also come from another client. If the two clients are from different chronicles, correct results are not guaranteed, so make a backup first. - Build from the map builds the geodata of the moved tiles again, and Rebuild pathnodes rebuilds the pathnode graph. - Update map image updates the map image in the start menu after the operation. - The dialog shows which world you are picking the tile in and which client will be changed.   Main and Classic worlds   - Clients with Classic maps have a Main / Classic switch. Classic opens X_Y_Classic.unr. - The Classic world has its own folders for captures, the map image and geodata. - If a client has no Classic maps, the switch is dimmed and cannot be changed.   Shadows (Custom Lighting) Note: the custom lighting must be enabled in settings/scene settings   - NPCs now also cast sun shadows on the ground and walls, and get darker in the shade of buildings and trees. - Shadows of buildings and trees are much sharper, with crisp edges on roofs and walls. - This has almost no effect on performance. Thanks, appreciate it!
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..