AntiFeed enabled and moved to PvP settings.

This commit is contained in:
MobiusDev 2015-11-29 18:35:06 +00:00
parent b9a2e9ab77
commit f2c0a2b678
4 changed files with 42 additions and 42 deletions

View File

@ -359,31 +359,6 @@ ScreenWelcomeMessageText = Welcome to our server!
ScreenWelcomeMessageTime = 10
# ---------------------------------------------------------------------------
# AntiFeed
# ---------------------------------------------------------------------------
# This option will enable antifeed for pvp/pk/clanrep points.
# Default: False
AntiFeedEnable = False
# If set to True, kills from dualbox will not increase pvp/pk points
# and clan reputation will not be transferred.
# Default: True
AntiFeedDualbox = True
# If set to True, server will count disconnected (unable to determine ip address)
# as dualbox.
# Default: True
AntiFeedDisconnectedAsDualbox = True
# If character died faster than timeout - pvp/pk points for killer will not increase
# and clan reputation will not be transferred.
# Setting to 0 will disable this feature.
# Default: 120 seconds.
AntiFeedInterval = 120
# ---------------------------------------------------------------------------
# Pvp/pk Announce
# ---------------------------------------------------------------------------

View File

@ -26,6 +26,30 @@ ListOfNonDroppableItems = 57,1147,425,1146,461,10,2368,7,6,2370,2369,6842,6611,6
MinimumPKRequiredToDrop = 6
# ---------------------------------------------------------------------------
# AntiFeed
# ---------------------------------------------------------------------------
# This option will enable antifeed for pvp/pk/clanrep points.
# Default: True
AntiFeedEnable = True
# If set to True, kills from dualbox will not increase pvp/pk points
# and clan reputation will not be transferred.
# Default: True
AntiFeedDualbox = True
# If set to True, server will count disconnected (unable to determine ip address) as dualbox.
# Default: True
AntiFeedDisconnectedAsDualbox = True
# If character died faster than timeout - pvp/pk points for killer will not increase
# and clan reputation will not be transferred.
# Setting to 0 will disable this feature.
# Retail: 86400 seconds (1 day).
AntiFeedInterval = 86400
# ---------------------------------------------------------------------------
# Misc.
# ---------------------------------------------------------------------------

View File

@ -767,10 +767,6 @@ public final class Config
public static boolean WELCOME_MESSAGE_ENABLED;
public static String WELCOME_MESSAGE_TEXT;
public static int WELCOME_MESSAGE_TIME;
public static boolean L2JMOD_ANTIFEED_ENABLE;
public static boolean L2JMOD_ANTIFEED_DUALBOX;
public static boolean L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX;
public static int L2JMOD_ANTIFEED_INTERVAL;
public static boolean ANNOUNCE_PK_PVP;
public static boolean ANNOUNCE_PK_PVP_NORMAL_MESSAGE;
public static String ANNOUNCE_PK_MSG;
@ -912,6 +908,10 @@ public final class Config
public static String KARMA_NONDROPPABLE_ITEMS;
public static int[] KARMA_LIST_NONDROPPABLE_PET_ITEMS;
public static int[] KARMA_LIST_NONDROPPABLE_ITEMS;
public static boolean ANTIFEED_ENABLE;
public static boolean ANTIFEED_DUALBOX;
public static boolean ANTIFEED_DISCONNECTED_AS_DUALBOX;
public static int ANTIFEED_INTERVAL;
// --------------------------------------------------
// Rate Settings
@ -2474,10 +2474,6 @@ public final class Config
WELCOME_MESSAGE_TEXT = CustomSettings.getString("ScreenWelcomeMessageText", "Welcome to L2J server!");
WELCOME_MESSAGE_TIME = CustomSettings.getInt("ScreenWelcomeMessageTime", 10) * 1000;
L2JMOD_ANTIFEED_ENABLE = CustomSettings.getBoolean("AntiFeedEnable", false);
L2JMOD_ANTIFEED_DUALBOX = CustomSettings.getBoolean("AntiFeedDualbox", true);
L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = CustomSettings.getBoolean("AntiFeedDisconnectedAsDualbox", true);
L2JMOD_ANTIFEED_INTERVAL = CustomSettings.getInt("AntiFeedInterval", 120) * 1000;
ANNOUNCE_PK_PVP = CustomSettings.getBoolean("AnnouncePkPvP", false);
ANNOUNCE_PK_PVP_NORMAL_MESSAGE = CustomSettings.getBoolean("AnnouncePkPvPNormalMessage", true);
ANNOUNCE_PK_MSG = CustomSettings.getString("AnnouncePkMsg", "$killer has slaughtered $target");
@ -2733,6 +2729,11 @@ public final class Config
KARMA_LIST_NONDROPPABLE_ITEMS[i] = Integer.parseInt(karma[i]);
}
ANTIFEED_ENABLE = PVPSettings.getBoolean("AntiFeedEnable", false);
ANTIFEED_DUALBOX = PVPSettings.getBoolean("AntiFeedDualbox", true);
ANTIFEED_DISCONNECTED_AS_DUALBOX = PVPSettings.getBoolean("AntiFeedDisconnectedAsDualbox", true);
ANTIFEED_INTERVAL = PVPSettings.getInt("AntiFeedInterval", 120) * 1000;
// sorting so binarySearch can be used later
Arrays.sort(KARMA_LIST_NONDROPPABLE_PET_ITEMS);
Arrays.sort(KARMA_LIST_NONDROPPABLE_ITEMS);
@ -3684,16 +3685,16 @@ public final class Config
L2JMOD_DISPLAY_SERVER_TIME = Boolean.parseBoolean(pValue);
break;
case "antifeedenable":
L2JMOD_ANTIFEED_ENABLE = Boolean.parseBoolean(pValue);
ANTIFEED_ENABLE = Boolean.parseBoolean(pValue);
break;
case "antifeeddualbox":
L2JMOD_ANTIFEED_DUALBOX = Boolean.parseBoolean(pValue);
ANTIFEED_DUALBOX = Boolean.parseBoolean(pValue);
break;
case "antifeeddisconnectedasdualbox":
L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(pValue);
ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(pValue);
break;
case "antifeedinterval":
L2JMOD_ANTIFEED_INTERVAL = 1000 * Integer.parseInt(pValue);
ANTIFEED_INTERVAL = 1000 * Integer.parseInt(pValue);
break;
case "cangmdropequipment":
KARMA_DROP_GM = Boolean.parseBoolean(pValue);

View File

@ -58,7 +58,7 @@ public final class AntiFeedManager
*/
public final boolean check(L2Character attacker, L2Character target)
{
if (!Config.L2JMOD_ANTIFEED_ENABLE)
if (!Config.ANTIFEED_ENABLE)
{
return true;
}
@ -74,15 +74,15 @@ public final class AntiFeedManager
return false;
}
if ((Config.L2JMOD_ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()))
if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()))
{
if ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.L2JMOD_ANTIFEED_INTERVAL)
if ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL)
{
return false;
}
}
if (Config.L2JMOD_ANTIFEED_DUALBOX && (attacker != null))
if (Config.ANTIFEED_DUALBOX && (attacker != null))
{
final L2PcInstance attackerPlayer = attacker.getActingPlayer();
if (attackerPlayer == null)
@ -95,7 +95,7 @@ public final class AntiFeedManager
if ((targetClient == null) || (attackerClient == null) || targetClient.isDetached() || attackerClient.isDetached())
{
// unable to check ip address
return !Config.L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX;
return !Config.ANTIFEED_DISCONNECTED_AS_DUALBOX;
}
return !targetClient.getConnectionAddress().equals(attackerClient.getConnectionAddress());