Información Adicional:--> Sistema creado por Fissban.
--> El captcha sale cada X cant de mobs muertos seteado en el config.
--> El tiempo para ingresar el captcha tambien es seteado desde config.
--> Tiene 3 posibilidades para ingresar el captcha de forma correcta...al fallar las 3 posibilidades seran enviados al jail por X tiempo q este seteado desde los configs.
--> El captcha generado consta de 4 numeros(imagenes) al azar de una lista de 10 en su total q va desde 0 hasta el 9...por lo tanto tenemos 10.000 posibiles captchas diferentes.
CitarVersión High Five:
### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: dist/game/config/L2JMods.properties
===================================================================
--- dist/game/config/L2JMods.properties (revision 6217)
+++ dist/game/config/L2JMods.properties (working copy)
@@ -479,4 +479,28 @@
# Enables .changepassword voiced command which allows the players to change their account's password ingame.
# Default: False
-AllowChangePassword = False
\ No newline at end of file
+AllowChangePassword = False
+
+###########################################
+# AntiBot #
+###########################################
+# author: fissban
+
+# Enable AntiBot system
+# default = True
+AntiBotEnable = False
+
+# Time the user will be in jail in minutes
+# default = 10
+AntiBotTimeJail = 10
+
+# Time that the user will have to control captcha in seconds
+# default = 30
+AntiBotTimeVote = 30
+
+# Dead mobs needed for captcha system
+AntiBotKillMobs = 100
+
+# Level min need for captcha system
+# default = 1
+AntiBotMinLevel = 1
\ No newline at end of file
Index: java/com/l2jserver/Config.java
===================================================================
--- java/com/l2jserver/Config.java (revision 6217)
+++ java/com/l2jserver/Config.java (working copy)
@@ -106,6 +106,13 @@
// --------------------------------------------------
// L2J Variable Definitions
// --------------------------------------------------
+ // AntiBot
+ public static boolean ANTIBOT_ENABLE;
+ public static int ANTIBOT_TIME_JAIL;
+ public static int ANTIBOT_TIME_VOTE;
+ public static int ANTIBOT_KILL_MOBS;
+ public static int ANTIBOT_MIN_LEVEL;
+
public static boolean ALT_GAME_DELEVEL;
public static boolean DECREASE_SKILL_LEVEL;
public static double ALT_WEIGHT_LIMIT;
@@ -2429,6 +2436,13 @@
_log.log(Level.SEVERE, "Error while loading L2JMod settings!", e);
}
+ // AntiBot
+ ANTIBOT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("AntiBotEnable", "true"));
+ ANTIBOT_TIME_JAIL = Integer.parseInt(L2JModSettings.getProperty("AntiBotTimeJail", "1"));
+ ANTIBOT_TIME_VOTE = Integer.parseInt(L2JModSettings.getProperty("AntiBotTimeVote", "30"));
+ ANTIBOT_KILL_MOBS = Integer.parseInt(L2JModSettings.getProperty("AntiBotKillMobs", "1"));
+ ANTIBOT_MIN_LEVEL = Integer.parseInt(L2JModSettings.getProperty("AntiBotMinLevel", "1"));
+
L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
L2JMOD_CHAMPION_PASSIVE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionPassive", "false"));
L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
Index: java/com/l2jserver/gameserver/model/actor/instance/Special/L2AntiBot.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/Special/L2AntiBot.java (revision 0)
+++ java/com/l2jserver/gameserver/model/actor/instance/Special/L2AntiBot.java (working copy)
@@ -0,0 +1,217 @@
+package com.l2jserver.gameserver.model.actor.instance.Special;
+
+import java.util.concurrent.ScheduledFuture;
+import java.util.logging.Logger;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.model.actor.L2Character;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.effects.AbnormalEffect;
+import com.l2jserver.gameserver.network.clientpackets.Say2;
+import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
+import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
+import com.l2jserver.util.Rnd;
+
+/**
+ * @author: fissban
+ */
+public class L2AntiBot
+{
+ public static final Logger _log = Logger.getLogger(L2AntiBot.class.getName());
+ private static L2AntiBot _instance;
+ public static ScheduledFuture<?> _antiBotTask;
+
+ private int _antibot;
+ private static String _code = "";
+
+ public L2AntiBot()
+ {
+ }
+
+ public static L2AntiBot getInstance()
+ {
+ if (_instance == null)
+ {
+ _instance = new L2AntiBot();
+ }
+ return _instance;
+ }
+
+ private static final String[] _IMG =
+ {
+ "L2UI_CT1.CharacterPassword_DF_Key0",
+ "L2UI_CT1.CharacterPassword_DF_Key1",
+ "L2UI_CT1.CharacterPassword_DF_Key2",
+ "L2UI_CT1.CharacterPassword_DF_Key3",
+ "L2UI_CT1.CharacterPassword_DF_Key4",
+ "L2UI_CT1.CharacterPassword_DF_Key5",
+ "L2UI_CT1.CharacterPassword_DF_Key6",
+ "L2UI_CT1.CharacterPassword_DF_Key7",
+ "L2UI_CT1.CharacterPassword_DF_Key8",
+ "L2UI_CT1.CharacterPassword_DF_Key9"
+ };
+
+ public void antibot(L2Character player)
+ {
+ _antibot++;
+
+ if (_antibot >= Config.ANTIBOT_KILL_MOBS)
+ {
+ _antibot = 0;
+ _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new StartAntiBotTask(player), Config.ANTIBOT_TIME_VOTE * 1000);
+ }
+ }
+
+ public static class StartAntiBotTask implements Runnable
+ {
+ L2Character _player_cha;
+ NpcHtmlMessage _npcHtmlMessage = new NpcHtmlMessage(0);
+
+ protected StartAntiBotTask(L2Character player)
+ {
+ if (player != null)
+ {
+ _player_cha = player;
+
+ _player_cha.getActingPlayer().setIsParalyzed(true);
+ _player_cha.getActingPlayer().setIsInvul(true);
+ _player_cha.getActingPlayer().startAbnormalEffect(AbnormalEffect.INVULNERABLE);
+ _player_cha.getActingPlayer().sendPacket(new ExShowScreenMessage("Have " + Config.ANTIBOT_TIME_VOTE + " seconds to confirm the Catpcha!", 10000));
+ _player_cha.getActingPlayer().getActingPlayer().sendPacket(new CreatureSay(0, Say2.BATTLEFIELD, "[AntiBot]", "Have " + Config.ANTIBOT_TIME_VOTE + " seconds to confirm the Catpcha!"));
+ _npcHtmlMessage.setHtml(ShowHtml_Start(_player_cha));
+ _player_cha.getActingPlayer().sendPacket(_npcHtmlMessage);
+ }
+ else
+ {
+ return;
+ }
+ }
+
+ @Override
+ public void run()
+ {
+ if (!_player_cha.getActingPlayer().isInJail())
+ {
+ _player_cha.getActingPlayer().sendPacket(new CreatureSay(0, Say2.TELL, "[AntiBot]", "Your time limit has elapsed!"));
+ _player_cha.getActingPlayer().increaseAttempt();
+
+ if (_player_cha.getActingPlayer().getAttempt() >= 3)
+ {
+ _player_cha.getActingPlayer().setIsParalyzed(false);
+ _player_cha.getActingPlayer().setIsInvul(false);
+ _player_cha.getActingPlayer().stopAbnormalEffect(AbnormalEffect.INVULNERABLE);
+ _player_cha.getActingPlayer().getActingPlayer().setPunishLevel(L2PcInstance.PunishLevel.JAIL, Config.ANTIBOT_TIME_JAIL);
+ _player_cha.getActingPlayer().getActingPlayer().sendPacket(new CreatureSay(0, Say2.TELL, "[AntiBot]", "Character " + _player_cha.getActingPlayer().getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes!"));
+ _log.warning("[AntiBot] Character " + _player_cha.getActingPlayer().getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes!");
+ }
+ else
+ {
+ _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new StartAntiBotTask(_player_cha), Config.ANTIBOT_TIME_VOTE * 1000);
+ }
+ }
+ }
+ }
+
+ public static String ShowHtml_Start(L2Character player)
+ {
+ String htmltext = "";
+ htmltext += "<html>";
+ htmltext += "<title>AntiBot by L2jAdmins";
+ htmltext += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"292\" height=\"350\" background=\"L2UI_CH3.refinewnd_back_Pattern\">";
+ htmltext += "<tr><td valign=\"top\" align=\"center\">";
+ htmltext += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
+ htmltext += "</table><br><br>";
+ htmltext += "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br></center>";
+ htmltext += "<center><font color=\"00C3FF\">" + player.getName() + "<font color=\"LEVEL\"> enter the captcha</center><br><br>";
+ htmltext += "<center><font color=\"LEVEL\">you get " + (3 - player.getActingPlayer().getAttempt()) + " chances to complete the captcha</center><br><br>";
+ htmltext += "<br>";
+
+ htmltext += "<table>";
+ htmltext += "<tr>";
+ _code = "";
+ for (int cont = 1; cont < 5; cont++)
+ {
+ int number = Rnd.get(_IMG.length - 1);
+ _code += String.valueOf(number);
+
+ htmltext += "<td><right><img src=\"" + _IMG[number] + "\" width=64 height=64 ></right></td>";
+ }
+
+ player.getActingPlayer().setCode(_code);
+ htmltext += "</tr>";
+ htmltext += "</table><br>";
+
+ htmltext += "<center><edit type=\"captcha\" var=\"captcha\" width=\"150\"></center>";
+ htmltext += "<center><button value=\"Confirm\" action=\"bypass -h antibot $captcha\" width=200 height=32 back=\"L2UI_CT1.OlympiadWnd_DF_HeroConfirm_Down\" fore=\"L2UI_CT1.OlympiadWnd_DF_HeroConfirm\"></center><br1>";
+ htmltext += "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center><br>";
+ htmltext += "</html></body>";
+
+ return htmltext;
+ }
+
+ public static String ShowHtml_End(L2Character player)
+ {
+ String htmltext = "";
+ htmltext += "<html>";
+ htmltext += "<title>AntiBot by L2jAdmins";
+ htmltext += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"292\" height=\"350\" background=\"L2UI_CH3.refinewnd_back_Pattern\">";
+ htmltext += "<tr><td valign=\"top\" align=\"center\">";
+ htmltext += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
+ htmltext += "</table><br><br>";
+ htmltext += "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br></center>";
+ htmltext += "<center><font color=\"00C3FF\">" + player.getName() + "<font color=\"LEVEL\"> FAIL enter the captcha</center><br><br>";
+ htmltext += "<br><br>";
+ htmltext += "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center><br>";
+ htmltext += "</html></body>";
+ return htmltext;
+ }
+
+ // bypass
+ public void checkCode(L2PcInstance player, String code)
+ {
+ if (code.equals(player.getCode()))
+ {
+ stopAntiBotTask();
+ player.setCheckCode(true);
+ player.resetAttemp();
+
+ player.sendPacket(new CreatureSay(0, Say2.TELL, "[AntiBot]", "Congratulations, has passed control!"));
+ player.setIsParalyzed(false);
+ player.setIsInvul(false);
+ player.stopAbnormalEffect(AbnormalEffect.INVULNERABLE);
+ }
+ else
+ {
+ stopAntiBotTask();
+ player.setCheckCode(false);
+ player.increaseAttempt();
+
+ _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new StartAntiBotTask(player), Config.ANTIBOT_TIME_VOTE * 1000);
+ }
+
+ if (player.getAttempt() >= 3)
+ {
+ stopAntiBotTask();
+ player.resetAttemp();
+
+ player.setIsParalyzed(false);
+ player.setIsInvul(false);
+ player.stopAbnormalEffect(AbnormalEffect.INVULNERABLE);
+
+ player.getActingPlayer().setPunishLevel(L2PcInstance.PunishLevel.JAIL, Config.ANTIBOT_TIME_JAIL);
+ player.getActingPlayer().sendPacket(new CreatureSay(0, Say2.TELL, "[AntiBot]", "Character " + player.getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes!"));
+ _log.warning("[AntiBot] Character " + player.getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes!");
+ }
+ }
+
+ public static void stopAntiBotTask()
+ {
+ if (_antiBotTask != null)
+ {
+ _antiBotTask.cancel(false);
+ _antiBotTask = null;
+ }
+ }
+}
\ No newline at end of file
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 6217)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -415,6 +415,11 @@
}
}
+ // AntiBot
+ private String _code = "";
+ private int _attempt = 0;
+ private boolean checkCode = false;
+
private L2GameClient _client;
private String _accountName;
@@ -16427,4 +16432,46 @@
{
return _eventListeners;
}
+
+ // AntiBoot
+ public void setCode(String code)
+ {
+ _code = code;
+ }
+
+ // AntiBoot
+ public String getCode()
+ {
+ return _code;
+ }
+
+ // AntiBoot
+ public void increaseAttempt()
+ {
+ _attempt += 1;
+ }
+
+ // AntiBoot
+ public int getAttempt()
+ {
+ return _attempt;
+ }
+
+ // AntiBoot
+ public void resetAttemp()
+ {
+ _attempt = 0;
+ }
+
+ // AntiBoot
+ public boolean getCheckCode()
+ {
+ return checkCode;
+ }
+
+ // AntiBoot
+ public void setCheckCode(boolean code)
+ {
+ checkCode = code;
+ }
}
\ No newline at end of file
Index: java/com/l2jserver/gameserver/model/actor/L2Attackable.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/L2Attackable.java (revision 6217)
+++ java/com/l2jserver/gameserver/model/actor/L2Attackable.java (working copy)
@@ -54,6 +54,7 @@
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
+import com.l2jserver.gameserver.model.actor.instance.Special.L2AntiBot;
import com.l2jserver.gameserver.model.actor.knownlist.AttackableKnownList;
import com.l2jserver.gameserver.model.actor.status.AttackableStatus;
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
@@ -567,6 +568,13 @@
{
_log.log(Level.SEVERE, "", e);
}
+
+ // antibot
+ if (Config.ANTIBOT_ENABLE && (killer != null) && killer.isPlayer() && (killer.getLevel() >= Config.ANTIBOT_MIN_LEVEL) && (killer.getInstanceId() == 0))
+ {
+ L2AntiBot.getInstance().antibot(killer);
+ }
+
return true;
}
### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java
===================================================================
--- java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java (revision 6217)
+++ java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
@@ -38,6 +38,7 @@
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2MerchantSummonInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.actor.instance.Special.L2AntiBot;
import com.l2jserver.gameserver.model.entity.Hero;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
@@ -330,6 +331,36 @@
handler.useBypass("arenachange " + (arenaId - 1), activeChar, null);
}
}
+ // AntiBot
+ else if (_command.startsWith("antibot"))
+ {
+ if (_command.length() >=
+ {
+ String texto = _command.substring(8);
+
+ StringTokenizer st = new StringTokenizer(texto);
+ try
+ {
+ String catpcha = null;
+
+ if (st.hasMoreTokens())
+ {
+ catpcha = st.nextToken();
+ }
+
+ L2AntiBot.getInstance().checkCode(activeChar, catpcha);
+ }
+ catch (Exception e)
+ {
+ activeChar.sendMessage("Un problema ocurrido durante la lectura del captcha!");
+ _log.log(Level.WARNING, "", e);
+ }
+ }
+ else
+ {
+ L2AntiBot.getInstance().checkCode(activeChar, "FAIL");
+ }
+ }
else
{
final IBypassHandler handler = BypassHandler.getInstance().getHandler(_command);
CitarVersión Freya:
### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: java/com/l2jserver/gameserver/model/actor/instance/L2AntiBot.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2AntiBot.java (revision 0)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2AntiBot.java (working copy)
@@ -0,0 +1,217 @@
+package com.l2jserver.gameserver.model.actor.instance;
+
+import java.util.concurrent.ScheduledFuture;
+import java.util.logging.Logger;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.model.actor.L2Character;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.clientpackets.Say2;
+import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
+import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
+import com.l2jserver.gameserver.skills.AbnormalEffect;
+import com.l2jserver.util.Rnd;
+
+/**
+ * @author: fissban
+ */
+public class L2AntiBot
+{
+ public static final Logger _log = Logger.getLogger(L2AntiBot.class.getName());
+ private static L2AntiBot _instance;
+ public static ScheduledFuture<?> _antiBotTask;
+
+ private int _antibot;
+ private static String _code = "";
+
+ public L2AntiBot()
+ {
+ }
+
+ public static L2AntiBot getInstance()
+ {
+ if (_instance == null)
+ {
+ _instance = new L2AntiBot();
+ }
+ return _instance;
+ }
+
+ private static final String[] _IMG =
+ {
+ "L2UI_CT1.CharacterPassword_DF_Key0",
+ "L2UI_CT1.CharacterPassword_DF_Key1",
+ "L2UI_CT1.CharacterPassword_DF_Key2",
+ "L2UI_CT1.CharacterPassword_DF_Key3",
+ "L2UI_CT1.CharacterPassword_DF_Key4",
+ "L2UI_CT1.CharacterPassword_DF_Key5",
+ "L2UI_CT1.CharacterPassword_DF_Key6",
+ "L2UI_CT1.CharacterPassword_DF_Key7",
+ "L2UI_CT1.CharacterPassword_DF_Key8",
+ "L2UI_CT1.CharacterPassword_DF_Key9"
+ };
+
+ public void antibot(L2Character player)
+ {
+ _antibot++;
+
+ if (_antibot >= Config.ANTIBOT_KILL_MOBS)
+ {
+ _antibot = 0;
+ _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new StartAntiBotTask(player), Config.ANTIBOT_TIME_VOTE * 1000);
+ }
+ }
+
+ public static class StartAntiBotTask implements Runnable
+ {
+ L2Character _player_cha;
+ NpcHtmlMessage _npcHtmlMessage = new NpcHtmlMessage(0);
+
+ protected StartAntiBotTask(L2Character player)
+ {
+ if (player != null)
+ {
+ _player_cha = player;
+
+ _player_cha.getActingPlayer().setIsParalyzed(true);
+ _player_cha.getActingPlayer().setIsInvul(true);
+ _player_cha.getActingPlayer().startAbnormalEffect(AbnormalEffect.INVULNERABLE);
+ _player_cha.getActingPlayer().sendPacket(new ExShowScreenMessage("Have " + Config.ANTIBOT_TIME_VOTE + " seconds to confirm the Catpcha!", 10000));
+ _player_cha.getActingPlayer().getActingPlayer().sendPacket(new CreatureSay(0, Say2.BATTLEFIELD, "[AntiBot]", "Have " + Config.ANTIBOT_TIME_VOTE + " seconds to confirm the Catpcha!"));
+ _npcHtmlMessage.setHtml(ShowHtml_Start(_player_cha));
+ _player_cha.getActingPlayer().sendPacket(_npcHtmlMessage);
+ }
+ else
+ {
+ return;
+ }
+ }
+
+ @Override
+ public void run()
+ {
+ if (!_player_cha.getActingPlayer().isInJail())
+ {
+ _player_cha.getActingPlayer().sendPacket(new CreatureSay(0, Say2.TELL, "[AntiBot]", "Your time limit has elapsed!"));
+ _player_cha.getActingPlayer().increaseAttempt();
+
+ if (_player_cha.getActingPlayer().getAttempt() >= 3)
+ {
+ _player_cha.getActingPlayer().setIsParalyzed(false);
+ _player_cha.getActingPlayer().setIsInvul(false);
+ _player_cha.getActingPlayer().stopAbnormalEffect(AbnormalEffect.INVULNERABLE);
+ _player_cha.getActingPlayer().getActingPlayer().setPunishLevel(L2PcInstance.PunishLevel.JAIL, Config.ANTIBOT_TIME_JAIL);
+ _player_cha.getActingPlayer().getActingPlayer().sendPacket(new CreatureSay(0, Say2.TELL, "[AntiBot]", "Character " + _player_cha.getActingPlayer().getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes!"));
+ _log.warning("[AntiBot] Character " + _player_cha.getActingPlayer().getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes!");
+ }
+ else
+ {
+ _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new StartAntiBotTask(_player_cha), Config.ANTIBOT_TIME_VOTE * 1000);
+ }
+ }
+ }
+ }
+
+ public static String ShowHtml_Start(L2Character player)
+ {
+ String htmltext = "";
+ htmltext += "<html>";
+ htmltext += "<title>AntiBot by L2jAdmins";
+ htmltext += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"292\" height=\"350\" background=\"L2UI_CH3.refinewnd_back_Pattern\">";
+ htmltext += "<tr><td valign=\"top\" align=\"center\">";
+ htmltext += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
+ htmltext += "</table><br><br>";
+ htmltext += "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br></center>";
+ htmltext += "<center><font color=\"00C3FF\">" + player.getName() + "<font color=\"LEVEL\"> enter the captcha</center><br><br>";
+ htmltext += "<center><font color=\"LEVEL\">you get " + (3 - player.getActingPlayer().getAttempt()) + " chances to complete the captcha</center><br><br>";
+ htmltext += "<br>";
+
+ htmltext += "<table>";
+ htmltext += "<tr>";
+ _code = "";
+ for (int cont = 1; cont < 5; cont++)
+ {
+ int number = Rnd.get(_IMG.length - 1);
+ _code += String.valueOf(number);
+
+ htmltext += "<td><right><img src=\"" + _IMG[number] + "\" width=64 height=64 ></right></td>";
+ }
+
+ player.getActingPlayer().setCode(_code);
+ htmltext += "</tr>";
+ htmltext += "</table><br>";
+
+ htmltext += "<center><edit type=\"captcha\" var=\"captcha\" width=\"150\"></center>";
+ htmltext += "<center><button value=\"Confirm\" action=\"bypass -h antibot $captcha\" width=200 height=32 back=\"L2UI_CT1.OlympiadWnd_DF_HeroConfirm_Down\" fore=\"L2UI_CT1.OlympiadWnd_DF_HeroConfirm\"></center><br1>";
+ htmltext += "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center><br>";
+ htmltext += "</html></body>";
+
+ return htmltext;
+ }
+
+ public static String ShowHtml_End(L2Character player)
+ {
+ String htmltext = "";
+ htmltext += "<html>";
+ htmltext += "<title>AntiBot by L2jAdmins";
+ htmltext += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"292\" height=\"350\" background=\"L2UI_CH3.refinewnd_back_Pattern\">";
+ htmltext += "<tr><td valign=\"top\" align=\"center\">";
+ htmltext += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
+ htmltext += "</table><br><br>";
+ htmltext += "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br></center>";
+ htmltext += "<center><font color=\"00C3FF\">" + player.getName() + "<font color=\"LEVEL\"> FAIL enter the captcha</center><br><br>";
+ htmltext += "<br><br>";
+ htmltext += "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center><br>";
+ htmltext += "</html></body>";
+ return htmltext;
+ }
+
+ // bypass
+ public void checkCode(L2PcInstance player, String code)
+ {
+ if (code.equals(player.getCode()))
+ {
+ stopAntiBotTask();
+ player.setCheckCode(true);
+ player.resetAttemp();
+
+ player.sendPacket(new CreatureSay(0, Say2.TELL, "[AntiBot]", "Congratulations, has passed control!"));
+ player.setIsParalyzed(false);
+ player.setIsInvul(false);
+ player.stopAbnormalEffect(AbnormalEffect.INVULNERABLE);
+ }
+ else
+ {
+ stopAntiBotTask();
+ player.setCheckCode(false);
+ player.increaseAttempt();
+
+ _antiBotTask = ThreadPoolManager.getInstance().scheduleGeneral(new StartAntiBotTask(player), Config.ANTIBOT_TIME_VOTE * 1000);
+ }
+
+ if (player.getAttempt() >= 3)
+ {
+ stopAntiBotTask();
+ player.resetAttemp();
+
+ player.setIsParalyzed(false);
+ player.setIsInvul(false);
+ player.stopAbnormalEffect(AbnormalEffect.INVULNERABLE);
+
+ player.getActingPlayer().setPunishLevel(L2PcInstance.PunishLevel.JAIL, Config.ANTIBOT_TIME_JAIL);
+ player.getActingPlayer().sendPacket(new CreatureSay(0, Say2.TELL, "[AntiBot]", "Character " + player.getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes!"));
+ _log.warning("[AntiBot] Character " + player.getName() + " jailed for " + Config.ANTIBOT_TIME_JAIL + " minutes!");
+ }
+ }
+
+ public static void stopAntiBotTask()
+ {
+ if (_antiBotTask != null)
+ {
+ _antiBotTask.cancel(false);
+ _antiBotTask = null;
+ }
+ }
+}
\ No newline at end of file
Index: java/com/l2jserver/Config.java
===================================================================
--- java/com/l2jserver/Config.java (revision 6243)
+++ java/com/l2jserver/Config.java (working copy)
@@ -725,7 +725,12 @@
public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP;
public static TIntIntHashMap L2JMOD_DUALBOX_CHECK_WHITELIST;
-
+ public static boolean ANTIBOT_ENABLE;
+ public static int ANTIBOT_TIME_JAIL;
+ public static int ANTIBOT_TIME_VOTE;
+ public static int ANTIBOT_KILL_MOBS;
+ public static int ANTIBOT_MIN_LEVEL;
+
//--------------------------------------------------
// NPC Settings
//--------------------------------------------------
@@ -2422,6 +2427,12 @@
}
}
+ ANTIBOT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("AntiBotEnable", "true"));
+ ANTIBOT_TIME_JAIL = Integer.parseInt(L2JModSettings.getProperty("AntiBotTimeJail", "1"));
+ ANTIBOT_TIME_VOTE = Integer.parseInt(L2JModSettings.getProperty("AntiBotTimeVote", "30"));
+ ANTIBOT_KILL_MOBS = Integer.parseInt(L2JModSettings.getProperty("AntiBotKillMobs", "1"));
+ ANTIBOT_MIN_LEVEL = Integer.parseInt(L2JModSettings.getProperty("AntiBotMinLevel", "1"));
+
BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false"));
BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
Index: java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java
===================================================================
--- java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java (revision 6243)
+++ java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
@@ -30,6 +30,7 @@
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2AntiBot;
import com.l2jserver.gameserver.model.actor.instance.L2MerchantSummonInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.Hero;
@@ -246,6 +247,36 @@
final IBypassHandler handler = BypassHandler.getInstance().getBypassHandler(_command);
if (handler != null)
handler.useBypass(_command, activeChar, null);
+ // AntiBot
+ else if (_command.startsWith("antibot"))
+ {
+ if (_command.length() >=
+ {
+ String texto = _command.substring(8);
+
+ StringTokenizer st = new StringTokenizer(texto);
+ try
+ {
+ String catpcha = null;
+
+ if (st.hasMoreTokens())
+ {
+ catpcha = st.nextToken();
+ }
+
+ L2AntiBot.getInstance().checkCode(activeChar, catpcha);
+ }
+ catch (Exception e)
+ {
+ activeChar.sendMessage("Un problema ocurrido durante la lectura del captcha!");
+ _log.log(Level.WARNING, "", e);
+ }
+ }
+ else
+ {
+ L2AntiBot.getInstance().checkCode(activeChar, "FAIL");
+ }
+ }
else
_log.log(Level.WARNING, getClient()+" sent not handled RequestBypassToServer: ["+_command+"]");
}
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 6243)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -364,6 +364,11 @@
}
}
+ // AntiBot
+ private String _code = "";
+ private int _attempt = 0;
+ private boolean checkCode = false;
+
private L2GameClient _client;
private String _accountName;
@@ -15075,4 +15080,45 @@
// Maintain = 1
return 0;
}
+ // AntiBoot
+ public void setCode(String code)
+ {
+ _code = code;
+ }
+
+ // AntiBoot
+ public String getCode()
+ {
+ return _code;
+ }
+
+ // AntiBoot
+ public void increaseAttempt()
+ {
+ _attempt = 1;
+ }
+
+ // AntiBoot
+ public int getAttempt()
+ {
+ return _attempt;
+ }
+
+ // AntiBoot
+ public void resetAttemp()
+ {
+ _attempt = 0;
+ }
+
+ // AntiBoot
+ public boolean getCheckCode()
+ {
+ return checkCode;
+ }
+
+ // AntiBoot
+ public void setCheckCode(boolean code)
+ {
+ checkCode = code;
+ }
}
Index: dist/game/config/l2jmods.properties
===================================================================
--- dist/game/config/l2jmods.properties (revision 6243)
+++ dist/game/config/l2jmods.properties (working copy)
@@ -426,3 +426,25 @@
# will be 1+2=3. Use 0 or negative value for unlimited number of connections.
# Default: 127.0.0.1,0 (no limits from localhost)
DualboxCheckWhitelist = 127.0.0.1,0
+
+# ---------------------------------------------------------------------------
+# AntiBot fissban
+# ---------------------------------------------------------------------------
+# Enable AntiBot system
+# default = True
+AntiBotEnable = True
+
+# Time the user will be in jail in minutes
+# default = 10
+AntiBotTimeJail = 10
+
+# Time that the user will have to control captcha in seconds
+# default = 30
+AntiBotTimeVote = 30
+
+# Dead mobs needed for captcha system
+AntiBotKillMobs = 100
+
+# Level min need for captcha system
+# default = 1
+AntiBotMinLevel = 1
\ No newline at end of file
Index: java/com/l2jserver/gameserver/model/actor/L2Attackable.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/L2Attackable.java (revision 6243)
+++ java/com/l2jserver/gameserver/model/actor/L2Attackable.java (working copy)
@@ -45,6 +45,7 @@
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.L2Party;
import com.l2jserver.gameserver.model.L2Skill;
+import com.l2jserver.gameserver.model.actor.instance.L2AntiBot;
import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
@@ -550,6 +551,12 @@
}
}
catch (Exception e) { _log.log(Level.SEVERE, "", e); }
+
+ // antibot
+ if (Config.ANTIBOT_ENABLE && (killer != null) && killer instanceof L2PcInstance && (killer.getLevel() >= Config.ANTIBOT_MIN_LEVEL) && (killer.getInstanceId() == 0))
+ {
+ L2AntiBot.getInstance().antibot(killer);
+ }
return true;
}