Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 84)
- +++ java/net/sf/l2j/Config.java (working copy)
- + public static boolean ENABLE_FARM_PVP;
- + ENABLE_FARM_PVP = server.getProperty("PvPProtect", false);
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/Player.java (revision 0)
- +++ java/net/sf/l2j/gameserver/model/actor/Player.java (working copy)
- @@ -0,0 +1,84 @@
- public void onKillUpdatePvPKarma(Playable target)
- {
- if (target == null)
- return;
- final Player targetPlayer = target.getActingPlayer();
- if (targetPlayer == null || targetPlayer == this)
- return;
- + if (Config.ENABLE_FARM_PVP)
- + checkAntiFarm();
- + public boolean checkAntiFarm()
- + {
- + for (Player target : World.getInstance().getPlayers())
- + {
- + if (getClient() != null && target.getClient() != null)
- + {
- + String ip1 = getClient().getConnection().getInetAddress().getHostAddress();
- + String ip2 = target.getClient().getConnection().getInetAddress().getHostAddress();
- +
- + if (ip1.equals(ip2))
- + {
- + LOGGER.warn("PvP Protection: " + getName() + " e " + target.getName() + ". mesmo IP.");
- + sendMessage(target.getName() + " é do seu mesmo IP, não sera contado o PvP. Isso poderar levar BAN!");
- + return false;
- + }
- + }
- + }
- + return true;
- + }
- + # =================================================================
- + # PvP Point Protect IP
- + # =================================================================
- + # Protect for PvP, players same Ip not win PVP point.
- + PvPProtect = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement