Jump to content
  • 0

[Resolved]help with bypass community board


Question

Posted

Hola comunidad, necesito ayuda ya que no puedo conseguir un bypass para trabajar en el tablero comunitario que estoy creando para teletransportarme.

Estoy usando la misma función que goto bypass,
lo que quiero hacer es poner _bbsgk; Tabla de teletransporte de identificación

 





	
	
		
			
	
			
			
	
	

 

15 answers to this question

Recommended Posts

  • 0
Posted (edited)

3 hours ago, djsocux said:

if (true)

xD

Nevermind, i don't see any possible reason why it shouldn't work. Is there any console/eclipse error?

Edited by Zake
  • 0
Posted
24 minutes ago, LexaKAZAN said:

)))

 

"_bbsgk;:rage:

 

final StringTokenizer st = new StringTokenizer(command, ";");:thumbs-up:

 

"_bbsgk":troll:

 

????????? :dunno:

 

 

What is the matter with you? there is nothing wrong there

  • 0
Posted (edited)

CommunityBoard.java

/*
 * 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 org.l2jmobius.gameserver.communitybbs;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.l2jmobius.Config;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.communitybbs.Manager.BaseBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.ClanBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.FavoriteBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.FriendsBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.GkBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.MailBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.PostBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.RegionBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.TopBBSManager;
import org.l2jmobius.gameserver.communitybbs.Manager.TopicBBSManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ShowBoard;
import org.l2jmobius.gameserver.util.BuilderUtil;

public class CommunityBoard
{
	/** The bypasses used by the players. */
	private final Map<Integer, String> _bypasses = new ConcurrentHashMap<>();
	protected static final String CB_PATH = "data/html/CommunityBoard/";
	
	protected CommunityBoard()
	{
	}
	
	public static CommunityBoard getInstance()
	{
		return SingletonHolder.INSTANCE;
	}
	
	@SuppressWarnings("static-access")
	public void handleCommands(GameClient client, String command)
	{
		final PlayerInstance player = client.getPlayer();
		if (player == null)
		{
			return;
		}
		
		if (!Config.ENABLE_COMMUNITY_BOARD)
		{
			player.sendPacket(SystemMessageId.THE_COMMUNITY_SERVER_IS_CURRENTLY_OFFLINE);
			return;
		}
		
		if (command.startsWith("_bbshome"))
		{
			TopBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsloc"))
		{
			RegionBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsclan"))
		{
			ClanBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsmemo"))
		{
			TopicBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsmail") || command.equals("_maillist_0_1_0_"))
		{
			MailBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_friend") || command.startsWith("_block"))
		{
			FriendsBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbstopics"))
		{
			TopicBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsposts"))
		{
			PostBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbsgetfav") || command.startsWith("bbs_add_fav") || command.startsWith("_bbsdelfav_"))
		{
			// player.sendPacket(new BuyList(TradeController.getInstance().getBuyList(1), 6393));
			// player.sendPacket(new BuyList(Multisell.getInstance().SeparateAndSend(1, player, 0, false, 0)));
			FavoriteBBSManager.getInstance().parseCmd(command, player);
		}
		else if (command.startsWith("_bbgk"))
		{
			GkBBSManager.getInstance().parseCmd(command, player);
		}
		else
		{
			BaseBBSManager.separateAndSend("<html><body><br><br><center>The command: " + command + " isn't implemented.</center></body></html>", player);
		}
	}
	
	public void handleWriteCommands(GameClient client, String url, String arg1, String arg2, String arg3, String arg4, String arg5)
	{
		final PlayerInstance player = client.getPlayer();
		if (player == null)
		{
			return;
		}
		
		if (!Config.ENABLE_COMMUNITY_BOARD)
		{
			player.sendPacket(SystemMessageId.THE_COMMUNITY_SERVER_IS_CURRENTLY_OFFLINE);
			return;
		}
		
		if (url.equals("Topic"))
		{
			TopicBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else if (url.equals("Post"))
		{
			PostBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else if (url.equals("_bbsloc"))
		{
			RegionBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else if (url.equals("_bbsclan"))
		{
			ClanBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else if (url.equals("Mail"))
		{
			MailBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else if (url.equals("_friend"))
		{
			FriendsBBSManager.getInstance().parseWrite(arg1, arg2, arg3, arg4, arg5, player);
		}
		else
		{
			BaseBBSManager.separateAndSend("<html><body><br><br><center>The command: " + url + " isn't implemented.</center></body></html>", player);
		}
	}
	protected void loadStaticHtm(String file, PlayerInstance player)
	{
		separateAndSend(HtmCache.getInstance().getHtm(CB_PATH + getFolder() + file), player);
	}
	
	public static void separateAndSend(String html, PlayerInstance acha)
	{
		if ((html == null) || (acha == null))
		{
			return;
		}
		
		if (html.length() < 4090)
		{
			acha.sendPacket(new ShowBoard(html, "101"));
			acha.sendPacket(ShowBoard.STATIC_SHOWBOARD_102);
			acha.sendPacket(ShowBoard.STATIC_SHOWBOARD_103);
		}
		else if (html.length() < 8180)
		{
			acha.sendPacket(new ShowBoard(html.substring(0, 4090), "101"));
			acha.sendPacket(new ShowBoard(html.substring(4090, html.length()), "102"));
			acha.sendPacket(ShowBoard.STATIC_SHOWBOARD_103);
		}
		else if (html.length() < 12270)
		{
			acha.sendPacket(new ShowBoard(html.substring(0, 4090), "101"));
			acha.sendPacket(new ShowBoard(html.substring(4090, 8180), "102"));
			acha.sendPacket(new ShowBoard(html.substring(8180, html.length()), "103"));
		}
	}
	
	/**
	 * Sets the last bypass used by the player.
	 * @param player the player
	 * @param title the title
	 * @param bypass the bypass
	 */
	public void addBypass(PlayerInstance player, String title, String bypass)
	{
		_bypasses.put(player.getObjectId(), title + "&" + bypass);
	}
	
	protected String getFolder()
	{
		return "";
	}
	
	/**
	 * Removes the last bypass used by the player.
	 * @param player the player
	 * @return the last bypass used
	 */
	public String removeBypass(PlayerInstance player)
	{
		return _bypasses.remove(player.getObjectId());
	}
	
	private static class SingletonHolder
	{
		protected static final CommunityBoard INSTANCE = new CommunityBoard();
	}
}

 

GkBBSManager.java

/*
* 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 org.l2jmobius.gameserver.communitybbs.Manager;

import java.util.StringTokenizer;

import org.l2jmobius.Config;
import org.l2jmobius.gameserver.datatables.sql.TeleportLocationTable;
import org.l2jmobius.gameserver.datatables.xml.ZoneData;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.model.TeleportLocation;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.zone.type.TownZone;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import org.l2jmobius.gameserver.network.serverpackets.ShowBoard;

public class GkBBSManager extends BaseBBSManager
{
	protected GkBBSManager()
	{
	}
	
	public static GkBBSManager getInstance()
	{
		return SingletonHolder.INSTANCE;
	}
	
	@Override
	public void parseCmd(String command, PlayerInstance player)
	{
		
		if (command.equals("_bbsgk"))
		{
			loadStaticHtm("gk/index.htm", player);
		}
		
		else if (command.startsWith("_bbsgk;"))
		{
			final StringTokenizer st = new StringTokenizer(command, ";");
			st.nextToken();
			if (st.countTokens() <= 0)
			{
				return;
			}
			final int whereTo = Integer.parseInt(st.nextToken());
			if (true)
			{
				player.sendPacket(new ShowBoard());
				doTeleport(player, whereTo);
				return;
			}
			
		}
		else
		{
			super.parseCmd(command, player);
		}
	}
	

	private void doTeleport(PlayerInstance player, int value)
	{
		final TeleportLocation list = TeleportLocationTable.getInstance().getTemplate(value);
		if (list != null)
		{
			// you cannot teleport to village that is in siege
			if (!SiegeManager.getInstance().isTeleportToSiegeAllowed() && (SiegeManager.getInstance().getSiege(list.getX(), list.getY(), list.getZ()) != null) && !player.isNoble())
			{
				player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
				return;
			}
			else if (!SiegeManager.getInstance().isTeleportToSiegeTownAllowed() && (ZoneData.getInstance().getZone(list.getX(), list.getY(), list.getZ(), TownZone.class) != null) && CastleManager.getInstance().findNearestCastle(list.getX(), list.getY()).getSiege().isInProgress() && !player.isNoble())
			{
				player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
				return;
			}
			else if (!player.isGM() && !Config.FLAGED_PLAYER_CAN_USE_GK && (player.getPvpFlag() > 0))
			{
				player.sendMessage("Don't run from PvP! You will be able to use the teleporter only after your flag is gone.");
				return;
			}
			else if (player.isAio() && !Config.ALLOW_AIO_USE_GK)
			{
				player.sendMessage("Aio Buffers are not allowed to use GateKeepers.");
				return;
			}
			else if (!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && (player.getKarma() > 0)) // karma
			{
				player.sendMessage("Go away, you're not welcome here.");
				return;
			}
			
			else if (player.isAlikeDead())
			{
				player.sendMessage("You can't use teleport when you are dead.");
				return;
			}
			else if (player.isSitting())
			{
				player.sendMessage("You can't use teleport when you are sitting.");
				return;
			}
			
			else if (!list.isForNoble() && ((player.getLevel() < 30) || player.destroyItem("Adena", 57, list.getPrice(), null, true)))
			{
				player.teleToLocation(list.getX(), list.getY(), list.getZ(), true);
			}
		}
		else
		{
			LOGGER.warning("No teleport destination with id:" + value);
		}
		player.sendPacket(ActionFailed.STATIC_PACKET);
	}
	
	@Override
	protected String getFolder()
	{
		return "top/";
	}
	
	private static class SingletonHolder
	{
		protected static final GkBBSManager INSTANCE = new GkBBSManager();
	}
}

that's the files I have everything registered
what I do not understand why I do not get the id of the teleport table

 

225b821761e6c8598cd6da364e19008eo.png

Edited by djsocux
  • 0
Posted

Come on you can't be that blind xD

else if (command.startsWith("_bbgk"))
		{
			GkBBSManager.getInstance().parseCmd(command, player);
		}

change _bbgk to _bbsgk

  • 0
Posted
13 minutes ago, djsocux said:

it works but when I am above lvl 31 it gives me inconrect item count

check your adenas and the price of teleport 

  • 0
Posted
4 hours ago, djsocux said:

it works but when I am above lvl 31 it gives me inconrect item count

else if (!list.isForNoble() && ((player.getLevel() < 30) || player.destroyItem("Adena", 57, list.getPrice(), null, true)))
			{
				player.teleToLocation(list.getX(), list.getY(), list.getZ(), true);
			}

player.destroyItem("Adena", 57, list.getPrice(), null, true)

this statement returns false for some reason, check the declaration of this method 

Guest
This topic is now closed to further replies.
  • Posts

    • Hi everyone, Since I’m no longer interested in L2 servers, if anyone is willing to continue the project, let me know. I’m currently selling the entire project. DM me for more information if you’re genuinely interested. I can offer limited free support for the first couple of months. It is not cheap. The sale includes the domain, the recently fully redesigned website, the updater, the interface, server files with Lucera ext source, and the database (excluding account passwords, emails, and other private information; character data can remain).   Server for test: https://lineage2.gold/download Server Info: https://lineage2.gold/info Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113  
    • You invent yourself a life - bad for you, one of the inner core dev, fernandopm, which worked hard over aCis quests from 2011 to 2016 is argentinian. I teached him back in time to work and make proper quests. My dev team comes from 10+ countries and I'm myself french. "Racist/nationalist" card ? Not working bro.   Not sure why I should thank you to send me questions, and regarding bug reports, so far, I got none of yours in either discord, gitlab, or forums. I'm sorry if you feel "ignored", but that's more a psychanalyst you need to speak with if you put emotions towards someones' appreciation over a forum. I never ignore a bug report, and if so (like skills reports), it's because I got a bigger plan (skills refactor, in that case). In any case, I delivered cookies for the bug report/fix, even if it dated of months, with proper credits over changesets. "Victim card" ? Not really working, but ok, maybe you're "emotional".   I barely make money out of aCis, for the spent time - simply selling my services, or even coding/administrating a minecraft/L2J server would make far more money. Breaking intentionally things would be stupid. If you don't understand I'm not the only one working on that pack, I can't help you. Also, the scale of edits is sometimes extreme - AI L2OFF ? 1800 files added. How do you want everything works in a single shot ? "Exploiting noobz for money" card ? Still not working, or I'm a terrible businessman.   Meanwhile - you shadow advertise your project, L2JOne (since 2017 btw) - you should maybe start by the beginning saying you're a competitor and aCis is actually a spike in your foot. That also explains why you act like that. RusAcis got the exact same strategy, speaking bad of me, saying they got unique fixes (you speak about I break things, they break and recode things 4 times sometimes, btw), but successfully reselling latest revision with poorly executed stuff. "aCis is good, Tryskell is ok, but I solve all issues in extreme low time so I can piss over him" card ? Mmmmhhhh.   Our conversation ends here if you want, I don't force ppl to speak with me if they don't want - hopefully, people would understand I'm not the arrogant one and the one who doesn't want to talk, or even collaborate. :). I understand you got your own project and got no will to improve aCis.   NOTE : I'm extremely happy for your call of ExShowServerPrimitive with getValidGeoLocation, extremely impressive. Arrogant, no. Sarcastic ? Maybe.   Good night everyone.
  • 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..

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock