Jump to content
  • 0

Help With CommunityBoard Services


Question

Posted

Hello Friends, i wanna add to my home community board a buttons, for example (buffer, gatekeeper). I write in the BoardsManager.java the command and in the ServicesBBSManager.java the command but in the game i am getting the message "the command _bbspipin;gatekeeper is not implemented yet. 

I dont know how can add this addons, has anyone the possibility to help me please?.
 

 

public class BoardsManager
{
	public void handleCommands(L2GameClient client, String command)
	{
		L2PcInstance activeChar = client.getActiveChar();
		if (activeChar == null)
		{
			return;
		}
		
		if (SunriseEvents.cbBypass(activeChar, command))
		{
			return;
		}
		
		if (CommunityDonateConfigs.COMMUNITY_DONATE_ALLOW && command.startsWith(CommunityDonateConfigs.BYPASS_COMMAND))
		{
			DonateBBSManager.getInstance().cbByPass(command, activeChar);
			return;
		}
		
		if (!Config.ENABLE_COMMUNITY)
		{
			activeChar.sendPacket(SystemMessageId.CB_OFFLINE);
			return;
		}
		
		if (command.startsWith(ServicesBBSManager.getInstance()._servicesBBSCommand))
		{
			ServicesBBSManager.getInstance().cbByPass(command, activeChar);
			return;
		}
		if (command.startsWith("_bbspipin"))
		{
			ServicesBBSManager.getInstance().cbByPass(command, activeChar);
		}
		
		if (command.startsWith("_bbsclan"))
		{
			ClanBBSManager.getInstance().cbByPass(command, activeChar);
		}
		else if (command.startsWith("_bbsmemo"))
		{
			// TopicBBSManager.getInstance().cbByPass(command, activeChar);
		}
		else if (command.startsWith("_bbstopics"))
		{
			TopicBBSManager.getInstance().cbByPass(command, activeChar);
		}
		else if (command.startsWith("_bbsposts"))
		{
			PostBBSManager.getInstance().cbByPass(command, activeChar);
		}
		else if (command.startsWith("_bbstop"))
		{
			TopBBSManager.getInstance().cbByPass(command, activeChar);
		}
		else if (command.startsWith("_bbshome"))
		{
			TopBBSManager.getInstance().cbByPass(command, activeChar);
		}
		else if (command.startsWith("_maillist"))
		{
			MailBBSManager.getInstance().cbByPass(command, activeChar);
		}
		else if (command.startsWith("_friendlist_0_") || command.startsWith("_bbs_friends") || command.startsWith("_bbsfriends"))
		{
			
		}
		else if (command.startsWith("_bbsloc"))
		{
			// RegionBBSManager.getInstance().cbByPass(command, activeChar);
		}
		else if (command.startsWith("_bbsgetfav") || command.startsWith("bbs_add_fav") || command.startsWith("_bbsdelfav_"))
		{
			FavoriteBBSManager.getInstance().cbByPass(command, activeChar);
		}
		else if (command.startsWith("_bbslink"))
		{
			// RegionBBSManager.getInstance().cbByPass(command, activeChar);
		}
		else
		{
			ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + command + " is not implemented yet</center><br><br></body></html>", "101");
			activeChar.sendPacket(sb);
			activeChar.sendPacket(new ShowBoard(null, "102"));
			activeChar.sendPacket(new ShowBoard(null, "103"));
		}
	}
	
	public void handleWriteCommands(L2GameClient client, String url, String arg1, String arg2, String arg3, String arg4, String arg5)
	{
		L2PcInstance activeChar = client.getActiveChar();
		if (activeChar == null)
		{
			return;
		}
		
		if (url.equals("Topic"))
		{
			TopicBBSManager.getInstance().parsewrite(url, arg1, arg2, arg3, arg4, arg5, activeChar);
		}
		else if (url.equals("Post"))
		{
			PostBBSManager.getInstance().parsewrite(url, arg1, arg2, arg3, arg4, arg5, activeChar);
		}
		else if (url.equals("Region"))
		{
			// Future usage
			// RegionBBSManager.getInstance().parsewrite(url, arg1, arg2, arg3, arg4, arg5, activeChar);
		}
		else if (url.equals("Friends"))
		{
			// Future usage
			// FriendsBBSManager.getInstance().parsewrite(url, arg1, arg2, arg3, arg4, arg5, activeChar);
		}
		else if (url.equals("Notice"))
		{
			ClanBBSManager.getInstance().parsewrite(url, arg1, arg2, arg3, arg4, arg5, activeChar);
		}
		else if (url.equals("Mail"))
		{
			MailBBSManager.getInstance().parsewrite(url, arg1, arg2, arg3, arg4, arg5, activeChar);
		}
		else
		{
			// no nothing
		}
		return;
	}
	
	// This will be used for favorite bbs manager
	/** The bypasses used by the players. */
	private final Map<Integer, String> _bypasses = new ConcurrentHashMap<>();
	
	/**
	 * Sets the last bypass used by the player.
	 * @param player the player
	 * @param title the title
	 * @param bypass the bypass
	 */
	public void addBypass(L2PcInstance player, String title, String bypass)
	{
		_bypasses.put(player.getObjectId(), title + "&" + bypass);
	}
	
	/**
	 * Removes the last bypass used by the player.
	 * @param player the player
	 * @return the last bypass used
	 */
	public String removeBypass(L2PcInstance player)
	{
		return _bypasses.remove(player.getObjectId());
	}
	
	public static BoardsManager getInstance()
	{
		return SingletonHolder._instance;
	}
	
	private static class SingletonHolder
	{
		protected static final BoardsManager _instance = new BoardsManager();
	}
}




// CLASS SERVICESBBSManager


public class ServicesBBSManager extends BaseBBSManager
{
	public String _servicesBBSCommand = CommunityServicesConfigs.BYPASS_COMMAND;
	
	@Override
	public void cbByPass(String command, L2PcInstance activeChar)
	{
		if (!CommunityServicesConfigs.COMMUNITY_SERVICES_ALLOW)
		{
			activeChar.sendMessage("This function is disabled by admin.");
			return;
		}
		
		String path = "data/html/CommunityBoard/services/";
		String filepath = "";
		String content = "";
		
		if (command.equals(_servicesBBSCommand + ""))
		{
			BoardsManager.getInstance().addBypass(activeChar, "Service Command", command);
			filepath = path + "main.htm";
			content = HtmCache.getInstance().getHtm(activeChar, activeChar.getHtmlPrefix(), filepath);
			separateAndSend(content, activeChar);
		}
		else if (command.startsWith("_bbspipin" + ";gatekeeper"))
		{
			BoardsManager.getInstance().addBypass(activeChar, "Service Command", command);
			filepath = path + "main.htm";
			content = HtmCache.getInstance().getHtm(activeChar, activeChar.getHtmlPrefix(), filepath);
			separateAndSend(content, activeChar);
		}
		else if (command.startsWith(_servicesBBSCommand + ";gatekeeper"))
		{
			BoardsManager.getInstance().addBypass(activeChar, "Service Gatekeeper", command);
			StringTokenizer st = new StringTokenizer(command, ";");
			st.nextToken();
			st.nextToken();
			String file = st.nextToken();
			path = "data/html/CommunityBoard/services/gatekeeper/";
			sendHtm(activeChar, filepath, path, file, command);
		}
		else if (command.startsWith(_servicesBBSCommand + ";"))
		{
			StringTokenizer st = new StringTokenizer(command, ";");
			st.nextToken();
			String file = st.nextToken();
			sendHtm(activeChar, filepath, path, file, command);
		}
		else if (command.startsWith(_servicesBBSCommand + "_sendMultisell"))
		{
			BoardsManager.getInstance().addBypass(activeChar, "Service Multisell", command);
			if (!CommunityServicesConfigs.COMMUNITY_SERVICES_SHOP_ALLOW)
			{
				activeChar.sendMessage("This function is disabled by admin.");
				return;
			}
			
			if (!CommunityServicesConfigs.COMMUNITY_SERVICES_SHOP_NONPEACE && !activeChar.isInsideZone(ZoneIdType.PEACE))
			{
				activeChar.sendMessage("You cannot use this function outside peace zone.");
			}
			else
			{
				try
				{
					String multisell = commandSeperator(command);
					int multi = Integer.valueOf(multisell);
					
					switch (multi)
					{
						case 90525:
							content = HtmCache.getInstance().getHtm(activeChar, activeChar.getHtmlPrefix(), "data/html/CommunityBoard/services/symbolMaker.htm");
							break;
						case 90526:
							content = HtmCache.getInstance().getHtm(activeChar, activeChar.getHtmlPrefix(), "data/html/CommunityBoard/services/warehouse.htm");
							break;
						case 90539:
						case 90540:
						case 90541:
							content = HtmCache.getInstance().getHtm(activeChar, activeChar.getHtmlPrefix(), "data/html/CommunityBoard/services/exclusiveShop.htm");
							break;
						default:
							content = HtmCache.getInstance().getHtm(activeChar, activeChar.getHtmlPrefix(), "data/html/CommunityBoard/services/gmshop.htm");
							break;
					}
					
					if ((multi == 90527) || (multi == 90528) || (multi == 90529) || (multi == 90530) || (multi == 90531) || (multi == 90532) || (multi == 90533) || (multi == 90534) || (multi == 90535) || (multi == 90536) || (multi == 90537) || (multi == 90538))
					{
						content = HtmCache.getInstance().getHtm(activeChar, activeChar.getHtmlPrefix(), "data/html/CommunityBoard/services/blacksmith.htm");
					}
					
					separateAndSend(content, activeChar);
					
					if (CommunityServicesConfigs.MULTISELL_LIST.contains(multi))
					{
						activeChar.setIsUsingAioMultisell(true);
						MultisellData.getInstance().separateAndSend(multi, activeChar, null, false);
					}
					else
					{
						SecurityActions.startSecurity(activeChar, SecurityType.COMMUNITY_SYSTEM);
					}
				}
				catch (Exception e)
				{
					SecurityActions.startSecurity(activeChar, SecurityType.COMMUNITY_SYSTEM);
				}
			}
		}
      
      
      and continues

 

2 answers to this question

Recommended Posts

  • 0
Posted

The code is awful

31 minutes ago, barao45 said:

else if (command.startsWith("_bbspipin" + ";gatekeeper")) { BoardsManager.getInstance().addBypass(activeChar, "Service Command", command); filepath = path + "main.htm"; content = HtmCache.getInstance().getHtm(activeChar, activeChar.getHtmlPrefix(), filepath); separateAndSend(content, activeChar); }

you can use substring here

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

    • To make up for some of the waiting time we’re hosting a 3v3 Tournament on open Beta, and this time we’re raising the stakes with a $1,300 prize pool 💰   🏆 PRIZE POOL BREAKDOWN (Over 2000$ Worth of prices total)   🥇 1st Place — $700 🥈 2nd Place —$300 🥉 3rd Place — $200 🏅 4th Place — $100  5th -6th Place - $100 in Gold Coins each    All Participating Teams: $50 in Gold!   All Prices will be Paid out instantly after the tour, no waiting time and conditions. This is not simply a marketing move, we want to give back to the community.   📅 Date: Wednesday 06.05.2026 ⏰ Time: 20:00 Central European Timezone (Berlin) 📍Format: 3v3   ⚔️Why join? Cash Prices for top 4 and rewards for all participants Payments to winners sent out straight after the tournament - No waiting time or rules that you have to play live server to obtain the reward. Clean format, smooth matches, and solid prize pool and a chance to experience our brand new files   📝How to join: Form your 3-player team Group Leader Sign up here: ⁠📍・3v3-tour-registration (Include Name of Group, Name of Group Leader)   Be ready on match day!     A separate post with rules for the tournament and class setups will follow shortly.   Tag your teammates, lock in your roster, and get ready to compete. We'll be happy to see you on the OBT!   💬 Questions? Ask in ⁠🎫・ticket or send us a message   See you on L2Dark! 😏   Discord: https://discord.gg/FAJwnFpb8M
    • You should check if that condition is supported by your current sources. You can find this in  DocumentBase#parsePlayerCondition If it isnt there and you want to follow the same pattern of the other item conditions, create a custom condition to parse the classId (or multiple class ids) (there are examples to copy the code). Alternatively, you can create your own condition handler. Your condition should look like this: <cond msgId="1518"> <player classId="ADVENTURER,PALADIN" /> </cond> or <cond msgId="1518"> <player classId="93,5" /> </cond>  
    • it's Interlude client forgot to mention
    • idk if acis have this option, but you can put inside item smth like that atleast on H5         <cond msgId="1518">             <player class_id_restriction="93, 101, 108, 117" /> <!-- Dagger Masters -->         </cond>
    • @GX-Ext I'm just waiting for the cheapest offer; I never said they wouldn't buy from you.  
  • 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..