Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
- index 72bd0c9..e953472 100644
- --- a/java/net/sf/l2j/Config.java
- +++ b/java/net/sf/l2j/Config.java
- @@ -133,7 +133,12 @@
- public static long CH_FRONT_FEE_RATIO;
- public static int CH_FRONT1_FEE;
- public static int CH_FRONT2_FEE;
- -
- + public static boolean BOTS_PREVENTION;
- + public static int KILLS_COUNTER;
- + public static int KILLS_COUNTER_RANDOMIZATION;
- + public static int VALIDATION_TIME;
- + public static int PUNISHMENT;
- + public static int PUNISHMENT_TIME;
- // --------------------------------------------------
- // Events settings
- // --------------------------------------------------
- @@ -1095,7 +1100,12 @@
- private static final void ProtectionMods()
- {
- final ExProperties Protection = initProperties(Config.PROTECTION_MODS);
- -
- + BOTS_PREVENTION = Boolean.parseBoolean(Protection.getProperty("EnableBotsPrevention", "false"));
- + KILLS_COUNTER = Integer.parseInt(Protection.getProperty("KillsCounter", "60"));
- + KILLS_COUNTER_RANDOMIZATION = Integer.parseInt(Protection.getProperty("KillsCounterRandomization", "50"));
- + VALIDATION_TIME = Integer.parseInt(Protection.getProperty("ValidationTime", "60"));
- + PUNISHMENT = Integer.parseInt(Protection.getProperty("Punishment", "0"));
- + PUNISHMENT_TIME = Integer.parseInt(Protection.getProperty("PunishmentTime", "60"));
- /*PHX_ENCHANT_WAREHOUSE = Boolean.parseBoolean(Protection.getProperty("EnableProtectionEnchantWarehouse", "false"));
- WELCOME_MESSAGE_ENCHANT = Protection.getProperty("ScreenEnchantMessageText", "Forbidden to Use Enchant near the bank!");
- WELCOME_MESSAGE_TIME_ENCHANT = Integer.parseInt(Protection.getProperty("ScreenEnchantMessageTime", "6")) * 1000;
- diff --git a/java/net/sf/l2j/gameserver/data/manager/BotsPreventionManager.java b/java/net/sf/l2j/gameserver/data/manager/BotsPreventionManager.java
- new file mode 100644
- index 0000000..2f5afd6
- --- /dev/null
- +++ b/java/net/sf/l2j/gameserver/data/manager/BotsPreventionManager.java
- @@ -0,0 +1,599 @@
- +package net.sf.l2j.gameserver.data.manager;
- +
- +import java.io.File;
- +import java.io.RandomAccessFile;
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.SQLException;
- +import java.util.ArrayList;
- +import java.util.Calendar;
- +import java.util.HashMap;
- +import java.util.List;
- +import java.util.Map;
- +import java.util.Random;
- +import java.util.concurrent.Future;
- +
- +import net.sf.l2j.Config;
- +
- +import net.sf.l2j.commons.lang.StringUtil;
- +import net.sf.l2j.commons.pool.ConnectionPool;
- +import net.sf.l2j.commons.pool.ThreadPool;
- +
- +import net.sf.l2j.gameserver.data.xml.MapRegionData;
- +import net.sf.l2j.gameserver.enums.PunishmentType;
- +import net.sf.l2j.gameserver.model.actor.Creature;
- +import net.sf.l2j.gameserver.model.actor.Player;
- +import net.sf.l2j.gameserver.model.actor.instance.Monster;
- +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- +import net.sf.l2j.gameserver.network.serverpackets.PledgeCrest;
- +
- +public class BotsPreventionManager
- +{
- + private class PlayerData
- + {
- + public PlayerData()
- + {
- + firstWindow = true;
- + }
- +
- + public int mainpattern;
- + public List<Integer> options = new ArrayList<>();
- + public boolean firstWindow;
- + public int patternid;
- + }
- +
- + protected Random _randomize;
- + protected static Map<Integer, Integer> _monsterscounter;
- + protected static Map<Integer, Future<?>> _beginvalidation;
- + protected static Map<Integer, PlayerData> _validation;
- + protected static Map<Integer, byte[]> _images;
- + protected int WINDOW_DELAY = 3; //delay used to generate new window if previous have been closed.
- + protected int VALIDATION_TIME = Config.VALIDATION_TIME * 1000;
- +
- + public static final BotsPreventionManager getInstance()
- + {
- + return SingletonHolder._instance;
- + }
- +
- + BotsPreventionManager()
- + {
- + _randomize = new Random();
- + _monsterscounter = new HashMap<>();
- + _beginvalidation = new HashMap<>();
- + _validation = new HashMap<>();
- + _images = new HashMap<>();
- + _beginvalidation = new HashMap<>();
- +
- + getimages();
- + }
- +
- + public void updatecounter(Creature player, Creature monster)
- + {
- + if ((player instanceof Player) && (monster instanceof Monster))
- + {
- + Player killer = (Player) player;
- +
- + if (_validation.get(killer.getObjectId()) != null)
- + {
- + return;
- + }
- +
- + int count = 1;
- + if (_monsterscounter.get(killer.getObjectId()) != null)
- + {
- + count = _monsterscounter.get(killer.getObjectId()) + 1;
- + }
- +
- + int next = _randomize.nextInt(Config.KILLS_COUNTER_RANDOMIZATION);
- + if (Config.KILLS_COUNTER + next < count)
- + {
- + validationtasks(killer);
- + _monsterscounter.remove(killer.getObjectId());
- + }
- + else
- + {
- + _monsterscounter.put(killer.getObjectId(), count);
- + }
- + }
- + }
- +
- + private static void getimages()
- + {
- + String CRESTS_DIR = "data/html/mods/prevention";
- +
- + final File directory = new File(CRESTS_DIR);
- + directory.mkdirs();
- +
- + int i = 0;
- + for (File file : directory.listFiles())
- + {
- + if (!file.getName().endsWith(".dds"))
- + continue;
- +
- + byte[] data;
- +
- + try (RandomAccessFile f = new RandomAccessFile(file, "r"))
- + {
- + data = new byte[(int) f.length()];
- + f.readFully(data);
- + }
- + catch (Exception e)
- + {
- + continue;
- + }
- + _images.put(i, data);
- + i++;
- + }
- + }
- +
- + public void prevalidationwindow(Player player)
- + {
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- + StringBuilder tb = new StringBuilder();
- + StringUtil.append(tb, "<html>");
- + StringUtil.append(tb, "<title>Bots prevention</title>");
- + StringUtil.append(tb, "<body><center><br><br><img src=\"L2UI_CH3.herotower_deco\" width=\"256\" height=\"32\">");
- + StringUtil.append(tb, "<br><br><font color=\"a2a0a2\">if such window appears it means server suspect,<br1>that you may using cheating software.</font>");
- + StringUtil.append(tb, "<br><br><font color=\"b09979\">if given answer results are incorrect or no action is made<br1>server is going to punish character instantly.</font>");
- + StringUtil.append(tb, "<br><br><button value=\"CONTINUE\" action=\"bypass report_continue\" width=\"75\" height=\"21\" back=\"L2UI_CH3.Btn1_normal\" fore=\"L2UI_CH3.Btn1_normal\">");
- + StringUtil.append(tb, "</center></body>");
- + StringUtil.append(tb, "</html>");
- + html.setHtml(tb.toString());
- + player.sendPacket(html);
- + }
- +
- + private static void validationwindow(Player player)
- + {
- + PlayerData container = _validation.get(player.getObjectId());
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- +
- + StringBuilder tb = new StringBuilder();
- + StringUtil.append(tb, "<html>");
- + StringUtil.append(tb, "<title>Bots prevention</title>");
- + StringUtil.append(tb, "<body><center><br><br><img src=\"L2UI_CH3.herotower_deco\" width=\"256\" height=\"32\">");
- + StringUtil.append(tb, "<br><br><font color=\"a2a0a2\">in order to prove you are a human being<br1>you've to</font> <font color=\"b09979\">match colours within generated pattern:</font>");
- +
- + // generated main pattern.
- + StringUtil.append(tb, "<br><br><img src=\"Crest.crest_" + Config.SERVER_ID + "_" + (_validation.get(player.getObjectId()).patternid) + "\" width=\"32\" height=\"32\"></td></tr>");
- + StringUtil.append(tb, "<br><br><font color=b09979>click-on pattern of your choice beneath:</font>");
- +
- + // generate random colours.
- + StringUtil.append(tb, "<table><tr>");
- + for (int i = 0; i < container.options.size(); i++)
- + {
- + StringUtil.append(tb, "<td><button action=\"bypass -h report_" + i + "\" width=32 height=32 back=\"Crest.crest_" + Config.SERVER_ID + "_" + (container.options.get(i) + 1500) + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + (container.options.get(i) + 1500) + "\"></td>");
- + }
- + StringUtil.append(tb, "</tr></table>");
- + StringUtil.append(tb, "</center></body>");
- + StringUtil.append(tb, "</html>");
- +
- + html.setHtml(tb.toString());
- + player.sendPacket(html);
- + }
- +
- + private static void validationOnewindow(Player player)
- + {
- + PlayerData container = _validation.get(player.getObjectId());
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- +
- + StringBuilder tb = new StringBuilder();
- + StringUtil.append(tb, "<html>");
- + StringUtil.append(tb, "<title>Bots prevention Second Chance</title>");
- + StringUtil.append(tb, "<body><center><br><br><img src=\"L2UI_CH3.herotower_deco\" width=\"256\" height=\"32\">");
- + StringUtil.append(tb, "<br><br><font color=\"a2a0a2\">in order to prove you are a human being<br1>you've to</font> <font color=\"b09979\">match colours within generated pattern:</font>");
- +
- + // generated main pattern.
- + StringUtil.append(tb, "<br><br><img src=\"Crest.crest_" + Config.SERVER_ID + "_" + (_validation.get(player.getObjectId()).patternid) + "\" width=\"32\" height=\"32\"></td></tr>");
- + StringUtil.append(tb, "<br><br><font color=b09979>click-on pattern of your choice beneath:</font>");
- +
- + // generate random colours.
- + StringUtil.append(tb, "<table><tr>");
- + for (int i = 0; i < container.options.size(); i++)
- + {
- + StringUtil.append(tb, "<td><button action=\"bypass -h one_" + i + "\" width=32 height=32 back=\"Crest.crest_" + Config.SERVER_ID + "_" + (container.options.get(i) + 1500) + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + (container.options.get(i) + 1500) + "\"></td>");
- + }
- + StringUtil.append(tb, "</tr></table>");
- + StringUtil.append(tb, "</center></body>");
- + StringUtil.append(tb, "</html>");
- +
- + html.setHtml(tb.toString());
- + player.sendPacket(html);
- + }
- +
- + private static void validationFinalwindow(Player player)
- + {
- + PlayerData container = _validation.get(player.getObjectId());
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- +
- + StringBuilder tb = new StringBuilder();
- + StringUtil.append(tb, "<html>");
- + StringUtil.append(tb, "<title>Bots prevention Final Chance</title>");
- + StringUtil.append(tb, "<body><center><br><br><img src=\"L2UI_CH3.herotower_deco\" width=\"256\" height=\"32\">");
- + StringUtil.append(tb, "<br><br><font color=\"a2a0a2\">in order to prove you are a human being<br1>you've to</font> <font color=\"b09979\">match colours within generated pattern:</font>");
- +
- + // generated main pattern.
- + StringUtil.append(tb, "<br><br><img src=\"Crest.crest_" + Config.SERVER_ID + "_" + (_validation.get(player.getObjectId()).patternid) + "\" width=\"32\" height=\"32\"></td></tr>");
- + StringUtil.append(tb, "<br><br><font color=b09979>click-on pattern of your choice beneath:</font>");
- +
- + // generate random colours.
- + StringUtil.append(tb, "<table><tr>");
- + for (int i = 0; i < container.options.size(); i++)
- + {
- + StringUtil.append(tb, "<td><button action=\"bypass -h final_" + i + "\" width=32 height=32 back=\"Crest.crest_" + Config.SERVER_ID + "_" + (container.options.get(i) + 1500) + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + (container.options.get(i) + 1500) + "\"></td>");
- + }
- + StringUtil.append(tb, "</tr></table>");
- + StringUtil.append(tb, "</center></body>");
- + StringUtil.append(tb, "</html>");
- +
- + html.setHtml(tb.toString());
- + player.sendPacket(html);
- + }
- +
- +
- + public void punishmentnwindow(Player player)
- + {
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- + StringBuilder tb = new StringBuilder();
- + StringUtil.append(tb, "<html>");
- + StringUtil.append(tb, "<title>Bots prevention</title>");
- + StringUtil.append(tb, "<body><center><br><br><img src=\"L2UI_CH3.herotower_deco\" width=\"256\" height=\"32\">");
- + StringUtil.append(tb, "<br><br><font color=\"a2a0a2\">if such window appears, it means character haven't<br1>passed through prevention system.");
- + StringUtil.append(tb, "<br><br><font color=\"b09979\">in such case character get moved to nearest town.</font>");
- + StringUtil.append(tb, "</center></body>");
- + StringUtil.append(tb, "</html>");
- + html.setHtml(tb.toString());
- + player.sendPacket(html);
- + }
- +
- + public void validationtasks(Player player)
- + {
- + PlayerData container = new PlayerData();
- + randomizeimages(container, player);
- +
- + for (int i = 0; i < container.options.size(); i++)
- + {
- + PledgeCrest packet = new PledgeCrest((container.options.get(i) + 1500), _images.get(container.options.get(i)));
- + player.sendPacket(packet);
- +
- + }
- +
- + PledgeCrest packet = new PledgeCrest(container.patternid, _images.get(container.options.get(container.mainpattern)));
- + player.sendPacket(packet);
- +
- + _validation.put(player.getObjectId(), container);
- +
- + Future<?> newTask = ThreadPool.schedule(new ReportCheckTask(player), VALIDATION_TIME);
- + ThreadPool.schedule(new countdown(player, VALIDATION_TIME / 1000), 0);
- + _beginvalidation.put(player.getObjectId(), newTask);
- + }
- +
- + protected void randomizeimages(PlayerData container,Player player)
- + {
- + int buttonscount = 4;
- + int imagescount = _images.size();
- +
- + for (int i = 0; i < buttonscount; i++)
- + {
- + int next = _randomize.nextInt(imagescount);
- + while (container.options.indexOf(next) > -1)
- + {
- + next = _randomize.nextInt(imagescount);
- + }
- + container.options.add(next);
- + }
- +
- + int mainIndex = _randomize.nextInt(buttonscount);
- + container.mainpattern = mainIndex;
- +
- + Calendar token = Calendar.getInstance();
- + String uniquetoken = Integer.toString(token.get(Calendar.DAY_OF_MONTH))+Integer.toString(token.get(Calendar.HOUR_OF_DAY))+Integer.toString(token.get(Calendar.MINUTE))+Integer.toString(token.get(Calendar.SECOND))+Integer.toString(token.get(Calendar.MILLISECOND)/100);
- + container.patternid = Integer.parseInt(uniquetoken);
- + }
- +
- + protected void banpunishment(Player player)
- + {
- + _validation.remove(player.getObjectId());
- + _beginvalidation.get(player.getObjectId()).cancel(true);
- + _beginvalidation.remove(player.getObjectId());
- +
- + switch (Config.PUNISHMENT)
- + {
- + // 0 = move character to the closest village.
- + // 1 = kick characters from the server.
- + // 2 = put character to jail.
- + // 3 = ban character from the server.
- + case 0:
- + player.getMove();
- + player.teleportTo(MapRegionData.TeleportType.TOWN);
- + punishmentnwindow(player);
- + break;
- + case 1:
- + if (player.isOnline())
- + {
- + player.logout(true);
- + }
- + break;
- + case 2:
- + jailpunishment(player, Config.PUNISHMENT_TIME * 60);
- + break;
- + case 3:
- + //player.setAccessLevel(-100);
- + changeaccesslevel(player, -100);
- + break;
- + }
- +
- + player.sendMessage("Unfortunately, colours doesn't match.");
- + }
- +
- + private static void changeaccesslevel(Player targetPlayer, int lvl)
- + {
- + if (targetPlayer.isOnline())
- + {
- + targetPlayer.getPunishment().setType(PunishmentType.ACC, 0);
- + targetPlayer.logout(true);
- + }
- + else
- + {
- + try (Connection con = ConnectionPool.getConnection())
- + {
- + @SuppressWarnings("resource")
- + PreparedStatement statement = con.prepareStatement("UPDATE characters SET accesslevel=? WHERE obj_id=?");
- + statement.setInt(1, lvl);
- + statement.setInt(2, targetPlayer.getObjectId());
- + statement.execute();
- + statement.close();
- + }
- + catch (SQLException se)
- + {
- + //if (Config.DEBUG)
- + se.printStackTrace();
- + }
- + }
- + }
- +
- + private static void jailpunishment(Player activeChar, int delay)
- + {
- + if (activeChar.isOnline())
- + {
- + activeChar.getPunishment().setType(PunishmentType.JAIL, Config.PUNISHMENT_TIME);
- + }
- + else
- + {
- + try (Connection con = ConnectionPool.getConnection())
- + {
- + @SuppressWarnings("resource")
- + PreparedStatement statement = con.prepareStatement("UPDATE characters SET x=?, y=?, z=?, punish_level=?, punish_timer=? WHERE obj_id=?");
- + statement.setInt(1, -114356);
- + statement.setInt(2, -249645);
- + statement.setInt(3, -2984);
- + statement.setInt(4, PunishmentType.JAIL.ordinal());
- + statement.setLong(5, (delay > 0 ? delay * Config.PUNISHMENT_TIME * 100 : 0));
- + statement.setInt(6, activeChar.getObjectId());
- +
- + statement.execute();
- + statement.close();
- + }
- + catch (SQLException se)
- + {
- + activeChar.sendMessage("SQLException while jailing player");
- + //if (Config.DEBUG)
- + se.printStackTrace();
- + }
- + }
- + }
- +
- + public void AnalyseBypass(String command, Player player)
- + {
- + if (!_validation.containsKey(player.getObjectId()))
- + return;
- +
- + String params = command.substring(command.indexOf("_") + 1);
- +
- + if (params.startsWith("continue"))
- + {
- + validationwindow(player);
- + _validation.get(player.getObjectId()).firstWindow = false;
- + return;
- + }
- +
- + int choosenoption = -1;
- + if (tryParseInt(params))
- + {
- + choosenoption = Integer.parseInt(params);
- + }
- +
- + if (choosenoption > -1)
- + {
- + PlayerData playerData = _validation.get(player.getObjectId());
- + if (choosenoption != playerData.mainpattern)
- + {
- + validationOnewindow(player);
- + _validation.get(player.getObjectId()).firstWindow = false;
- + return;
- + }
- +
- + player.sendMessage("Congratulations, colours match!");
- + _validation.remove(player.getObjectId());
- + _beginvalidation.get(player.getObjectId()).cancel(true);
- + _beginvalidation.remove(player.getObjectId());
- + }
- + }
- +
- + public void AnalyseOneBypass(String command, Player player)
- + {
- + if (!_validation.containsKey(player.getObjectId()))
- + return;
- +
- + String params = command.substring(command.indexOf("_") + 1);
- +
- + if (params.startsWith("continue"))
- + {
- + validationwindow(player);
- + _validation.get(player.getObjectId()).firstWindow = false;
- + return;
- + }
- +
- + int choosenoption = -1;
- + if (tryParseInt(params))
- + {
- + choosenoption = Integer.parseInt(params);
- + }
- +
- + if (choosenoption > -1)
- + {
- + PlayerData playerData = _validation.get(player.getObjectId());
- + if (choosenoption != playerData.mainpattern)
- + {
- + validationFinalwindow(player);
- + _validation.get(player.getObjectId()).firstWindow = false;
- + return;
- + }
- +
- + player.sendMessage("Congratulations, colours match!");
- + _validation.remove(player.getObjectId());
- + _beginvalidation.get(player.getObjectId()).cancel(true);
- + _beginvalidation.remove(player.getObjectId());
- + }
- + }
- +
- + public void AnalyseFinalBypass(String command, Player player)
- + {
- + if (!_validation.containsKey(player.getObjectId()))
- + return;
- +
- + String params = command.substring(command.indexOf("_") + 1);
- +
- + if (params.startsWith("continue"))
- + {
- + validationwindow(player);
- + _validation.get(player.getObjectId()).firstWindow = false;
- + return;
- + }
- +
- + int choosenoption = -1;
- + if (tryParseInt(params))
- + {
- + choosenoption = Integer.parseInt(params);
- + }
- +
- + if (choosenoption > -1)
- + {
- + PlayerData playerData = _validation.get(player.getObjectId());
- + if (choosenoption != playerData.mainpattern)
- + banpunishment(player);
- + else
- + {
- + player.sendMessage("Congratulations, colours match!");
- + _validation.remove(player.getObjectId());
- + _beginvalidation.get(player.getObjectId()).cancel(true);
- + _beginvalidation.remove(player.getObjectId());
- + }
- + }
- + }
- +
- + protected class countdown implements Runnable
- + {
- + private final Player _player;
- + private int _time;
- +
- + public countdown(Player player, int time)
- + {
- + _time = time;
- + _player = player;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_player.isOnline())
- + {
- + if (_validation.containsKey(_player.getObjectId()) && _validation.get(_player.getObjectId()).firstWindow)
- + {
- + if (_time % WINDOW_DELAY == 0)
- + {
- + prevalidationwindow(_player);
- + }
- + }
- +
- + switch (_time)
- + {
- + case 300:
- + case 240:
- + case 180:
- + case 120:
- + case 60:
- + _player.sendMessage(_time / 60 + " minute(s) to match colors.");
- + break;
- + case 30:
- + case 10:
- + case 5:
- + case 4:
- + case 3:
- + case 2:
- + case 1:
- + _player.sendMessage(_time + " second(s) to match colors!");
- + break;
- + }
- + if (_time > 1 && _validation.containsKey(_player.getObjectId()))
- + {
- + ThreadPool.schedule(new countdown(_player, _time - 1), 1000);
- + }
- + }
- + }
- + }
- +
- + protected boolean tryParseInt(String value)
- + {
- + try
- + {
- + Integer.parseInt(value);
- + return true;
- + }
- +
- + catch (NumberFormatException e)
- + {
- + return false;
- + }
- + }
- +
- + public void CaptchaSuccessfull(Player player)
- + {
- + if (_validation.get(player.getObjectId()) != null)
- + {
- + _validation.remove(player.getObjectId());
- + }
- + }
- +
- + public Boolean IsAlredyInReportMode(Player player)
- + {
- + if (_validation.get(player.getObjectId()) != null)
- + {
- + return true;
- + }
- + return false;
- + }
- +
- + private class ReportCheckTask implements Runnable
- + {
- + private final Player _player;
- +
- + public ReportCheckTask(Player player)
- + {
- + _player = player;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_validation.get(_player.getObjectId()) != null)
- + {
- + banpunishment(_player);
- + }
- + }
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final BotsPreventionManager _instance = new BotsPreventionManager();
- + }
- +}
- \ No newline at end of file
- diff --git a/java/net/sf/l2j/gameserver/model/actor/Creature.java b/java/net/sf/l2j/gameserver/model/actor/Creature.java
- index 21a1581..95d63d2 100644
- --- a/java/net/sf/l2j/gameserver/model/actor/Creature.java
- +++ b/java/net/sf/l2j/gameserver/model/actor/Creature.java
- @@ -10,6 +10,7 @@
- import net.sf.l2j.commons.random.Rnd;
- import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.data.manager.BotsPreventionManager;
- import net.sf.l2j.gameserver.data.manager.ZoneManager;
- import net.sf.l2j.gameserver.data.xml.MapRegionData;
- import net.sf.l2j.gameserver.data.xml.MapRegionData.TeleportType;
- @@ -482,7 +483,10 @@
- stopAllEffectsExceptThoseThatLastThroughDeath();
- calculateRewards(killer);
- -
- + if (Config.BOTS_PREVENTION)
- + {
- + BotsPreventionManager.getInstance().updatecounter(killer,this);
- + }
- // Send the Server->Client packet StatusUpdate with current HP and MP to all other Player to inform
- getStatus().broadcastStatusUpdate();
- diff --git a/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java b/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
- index 1b528aa..2b9da15 100644
- --- a/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
- +++ b/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
- @@ -5,6 +5,7 @@
- import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.communitybbs.CommunityBoard;
- +import net.sf.l2j.gameserver.data.manager.BotsPreventionManager;
- import net.sf.l2j.gameserver.data.manager.HeroManager;
- import net.sf.l2j.gameserver.data.xml.AdminData;
- import net.sf.l2j.gameserver.enums.FloodProtector;
- @@ -182,6 +183,18 @@
- if (heroid > 0)
- HeroManager.getInstance().showHeroDiary(player, heroclass, heroid, heropage);
- }
- + else if (_command.startsWith("report"))
- + {
- + BotsPreventionManager.getInstance().AnalyseBypass(_command,player);
- + }
- + else if (_command.startsWith("one"))
- + {
- + BotsPreventionManager.getInstance().AnalyseOneBypass(_command,player);
- + }
- + else if (_command.startsWith("final"))
- + {
- + BotsPreventionManager.getInstance().AnalyseFinalBypass(_command,player);
- + }
- else if (_command.startsWith("arenachange")) // change
- {
- final boolean isManager = player.getCurrentFolk() instanceof OlympiadManagerNpc;
- diff --git a/java/net/sf/l2j/gameserver/network/serverpackets/PledgeCrest.java b/java/net/sf/l2j/gameserver/network/serverpackets/PledgeCrest.java
- index 6bedc60..ec88baf 100644
- --- a/java/net/sf/l2j/gameserver/network/serverpackets/PledgeCrest.java
- +++ b/java/net/sf/l2j/gameserver/network/serverpackets/PledgeCrest.java
- @@ -13,7 +13,11 @@
- _crestId = crestId;
- _data = CrestCache.getInstance().getCrest(CrestType.PLEDGE, _crestId);
- }
- -
- + public PledgeCrest(int crestId, byte[] data)
- + {
- + _crestId = crestId;
- + _data = data;
- + }
- @Override
- protected final void writeImpl()
- {
- Index: DataPack
- +# ===============================================================
- +# Ant Bot
- +# ===============================================================
- +# Bots prevention system.
- +EnableBotsPrevention = True
- +# How many monsters have to be killed to run validation task?
- +KillsCounter = 1
- +# Specify range of randomly taken values summed with main counter.
- +KillsCounterRandomization = 1
- +# How long validation window awaits an answer? (in seconds)
- +ValidationTime = 15
- +# Punishments:
- +# 0 = move character to the closest village.
- +# 1 = kick characters from the server.
- +# 2 = put character to jail.
- +# 3 = ban character from the server.
- +Punishment = 0
- +# How long character were suppose to stay in jail? (in minutes)
- +PunishmentTime = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement