Minor Link bypass improvements.

This commit is contained in:
MobiusDevelopment 2019-04-12 06:57:00 +00:00
parent a96e5e99f3
commit 4ba7bc7721
12 changed files with 78 additions and 24 deletions

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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))
{

View File

@ -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))
{

View File

@ -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))
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{