From 4ba7bc7721866b8722dc32022df35e4f5ee519b6 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 12 Apr 2019 06:57:00 +0000 Subject: [PATCH] Minor Link bypass improvements. --- .../data/scripts/handlers/bypasshandlers/Link.java | 10 ++++++++-- .../data/scripts/handlers/bypasshandlers/Link.java | 10 ++++++++-- .../data/scripts/handlers/bypasshandlers/Link.java | 10 ++++++++-- .../data/scripts/handlers/bypasshandlers/Link.java | 10 ++++++++-- .../data/scripts/handlers/bypasshandlers/Link.java | 4 ++-- .../data/scripts/handlers/bypasshandlers/Link.java | 4 ++-- .../data/scripts/handlers/bypasshandlers/Link.java | 4 ++-- .../data/scripts/handlers/bypasshandlers/Link.java | 10 ++++++++-- .../data/scripts/handlers/bypasshandlers/Link.java | 10 ++++++++-- .../data/scripts/handlers/bypasshandlers/Link.java | 10 ++++++++-- .../data/scripts/handlers/bypasshandlers/Link.java | 10 ++++++++-- .../data/scripts/handlers/bypasshandlers/Link.java | 10 ++++++++-- 12 files changed, 78 insertions(+), 24 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/Link.java index f90a237ee6..3c8535fd42 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.actor.Creature; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.actor.instance.TeleporterInstance; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; public class Link implements IBypassHandler @@ -30,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "common/attribute_info.htm", "common/augmentation_01.htm", @@ -88,7 +89,12 @@ public class Link implements IBypassHandler return false; } - final String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + // Precaution. + if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) + { + content = null; + } final NpcHtmlMessage html = new NpcHtmlMessage(target != null ? target.getObjectId() : 0); if (content != null) { diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/Link.java index 47a82701b5..f21699c655 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.actor.Creature; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.actor.instance.TeleporterInstance; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; public class Link implements IBypassHandler @@ -30,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "common/attribute_info.htm", "common/augmentation_01.htm", @@ -91,7 +92,12 @@ public class Link implements IBypassHandler return false; } - final String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + // Precaution. + if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) + { + content = null; + } final NpcHtmlMessage html = new NpcHtmlMessage(target != null ? target.getObjectId() : 0); if (content != null) { diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/Link.java index 47a82701b5..f21699c655 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.actor.Creature; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.actor.instance.TeleporterInstance; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; public class Link implements IBypassHandler @@ -30,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "common/attribute_info.htm", "common/augmentation_01.htm", @@ -91,7 +92,12 @@ public class Link implements IBypassHandler return false; } - final String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + // Precaution. + if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) + { + content = null; + } final NpcHtmlMessage html = new NpcHtmlMessage(target != null ? target.getObjectId() : 0); if (content != null) { diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/bypasshandlers/Link.java index 47a82701b5..f21699c655 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.actor.Creature; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.actor.instance.TeleporterInstance; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; public class Link implements IBypassHandler @@ -30,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "common/attribute_info.htm", "common/augmentation_01.htm", @@ -91,7 +92,12 @@ public class Link implements IBypassHandler return false; } - final String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + // Precaution. + if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) + { + content = null; + } final NpcHtmlMessage html = new NpcHtmlMessage(target != null ? target.getObjectId() : 0); if (content != null) { diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/bypasshandlers/Link.java index e388860644..2f66b9d886 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -31,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "common/attribute_info.htm", "common/augmentation_01.htm", @@ -109,7 +109,7 @@ public class Link implements IBypassHandler return false; } - String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; // Precaution. if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) { diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/bypasshandlers/Link.java index e388860644..2f66b9d886 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -31,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "common/attribute_info.htm", "common/augmentation_01.htm", @@ -109,7 +109,7 @@ public class Link implements IBypassHandler return false; } - String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; // Precaution. if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) { diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/bypasshandlers/Link.java index e388860644..2f66b9d886 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -31,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "common/attribute_info.htm", "common/augmentation_01.htm", @@ -109,7 +109,7 @@ public class Link implements IBypassHandler return false; } - String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; // Precaution. if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/Link.java index 58c201d8e5..544fbf233a 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.actor.Creature; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.actor.instance.TeleporterInstance; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; public class Link implements IBypassHandler @@ -30,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "adventurer_guildsman/AboutHighLevelGuilds.htm", "adventurer_guildsman/AboutNewLifeCrystals.htm", @@ -91,7 +92,12 @@ public class Link implements IBypassHandler return false; } - final String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + // Precaution. + if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) + { + content = null; + } final NpcHtmlMessage html = new NpcHtmlMessage(target != null ? target.getObjectId() : 0); if (content != null) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/Link.java index 43c819a86b..667528b455 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.actor.Creature; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.actor.instance.TeleporterInstance; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; public class Link implements IBypassHandler @@ -30,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "common/craft_01.htm", "common/craft_02.htm", @@ -75,7 +76,12 @@ public class Link implements IBypassHandler return false; } - final String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + // Precaution. + if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) + { + content = null; + } final NpcHtmlMessage html = new NpcHtmlMessage(target != null ? target.getObjectId() : 0); if (content != null) { diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/bypasshandlers/Link.java index 43c819a86b..667528b455 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.actor.Creature; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.actor.instance.TeleporterInstance; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; public class Link implements IBypassHandler @@ -30,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "common/craft_01.htm", "common/craft_02.htm", @@ -75,7 +76,12 @@ public class Link implements IBypassHandler return false; } - final String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + // Precaution. + if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) + { + content = null; + } final NpcHtmlMessage html = new NpcHtmlMessage(target != null ? target.getObjectId() : 0); if (content != null) { diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/bypasshandlers/Link.java index 43c819a86b..667528b455 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.actor.Creature; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.actor.instance.TeleporterInstance; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; public class Link implements IBypassHandler @@ -30,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "common/craft_01.htm", "common/craft_02.htm", @@ -75,7 +76,12 @@ public class Link implements IBypassHandler return false; } - final String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + // Precaution. + if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) + { + content = null; + } final NpcHtmlMessage html = new NpcHtmlMessage(target != null ? target.getObjectId() : 0); if (content != null) { diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/bypasshandlers/Link.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/bypasshandlers/Link.java index 43c819a86b..667528b455 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/bypasshandlers/Link.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/bypasshandlers/Link.java @@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.actor.Creature; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.actor.instance.TeleporterInstance; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; public class Link implements IBypassHandler @@ -30,7 +31,7 @@ public class Link implements IBypassHandler "Link" }; - private static final String[] VALID_BYPASSES = + private static final String[] VALID_LINKS = { "common/craft_01.htm", "common/craft_02.htm", @@ -75,7 +76,12 @@ public class Link implements IBypassHandler return false; } - final String content = CommonUtil.contains(VALID_BYPASSES, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + String content = CommonUtil.contains(VALID_LINKS, htmlPath) ? HtmCache.getInstance().getHtm(player, "data/html/" + htmlPath) : null; + // Precaution. + if (htmlPath.startsWith("teleporter/") && !(player.getTarget() instanceof TeleporterInstance)) + { + content = null; + } final NpcHtmlMessage html = new NpcHtmlMessage(target != null ? target.getObjectId() : 0); if (content != null) {