Addition of EnchantItem flood protector configuration.

This commit is contained in:
MobiusDevelopment 2023-03-25 15:36:16 +02:00
parent 3d49d1284d
commit 5d7f71a46b
4 changed files with 18 additions and 2 deletions

View File

@ -60,6 +60,13 @@ FloodProtectorDropItemPunishmentLimit = 0
FloodProtectorDropItemPunishmentType = none FloodProtectorDropItemPunishmentType = none
FloodProtectorDropItemPunishmentTime = 0 FloodProtectorDropItemPunishmentTime = 0
# EnchantItem - flooding
FloodProtectorEnchantItemInterval = 15
FloodProtectorEnchantItemLogFlooding = False
FloodProtectorEnchantItemPunishmentLimit = 0
FloodProtectorEnchantItemPunishmentType = none
FloodProtectorEnchantItemPunishmentTime = 0
# ServerBypass - server bypass flooding # ServerBypass - server bypass flooding
FloodProtectorServerBypassInterval = 5 FloodProtectorServerBypassInterval = 5
FloodProtectorServerBypassLogFlooding = False FloodProtectorServerBypassLogFlooding = False

View File

@ -683,6 +683,7 @@ public class Config
public static FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT; public static FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT;
public static FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS; public static FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS;
public static FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM; public static FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM;
public static FloodProtectorConfig FLOOD_PROTECTOR_ENCHANT_ITEM;
public static FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS; public static FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS;
public static FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL; public static FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL;
public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION; public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION;
@ -1316,6 +1317,7 @@ public class Config
FLOOD_PROTECTOR_GLOBAL_CHAT = new FloodProtectorConfig("GlobalChatFloodProtector"); FLOOD_PROTECTOR_GLOBAL_CHAT = new FloodProtectorConfig("GlobalChatFloodProtector");
FLOOD_PROTECTOR_SUBCLASS = new FloodProtectorConfig("SubclassFloodProtector"); FLOOD_PROTECTOR_SUBCLASS = new FloodProtectorConfig("SubclassFloodProtector");
FLOOD_PROTECTOR_DROP_ITEM = new FloodProtectorConfig("DropItemFloodProtector"); FLOOD_PROTECTOR_DROP_ITEM = new FloodProtectorConfig("DropItemFloodProtector");
FLOOD_PROTECTOR_ENCHANT_ITEM = new FloodProtectorConfig("EnchantItemFloodProtector");
FLOOD_PROTECTOR_SERVER_BYPASS = new FloodProtectorConfig("ServerBypassFloodProtector"); FLOOD_PROTECTOR_SERVER_BYPASS = new FloodProtectorConfig("ServerBypassFloodProtector");
FLOOD_PROTECTOR_MULTISELL = new FloodProtectorConfig("MultiSellFloodProtector"); FLOOD_PROTECTOR_MULTISELL = new FloodProtectorConfig("MultiSellFloodProtector");
FLOOD_PROTECTOR_TRANSACTION = new FloodProtectorConfig("TransactionFloodProtector"); FLOOD_PROTECTOR_TRANSACTION = new FloodProtectorConfig("TransactionFloodProtector");
@ -3147,6 +3149,7 @@ public class Config
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", 5); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", 5);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", 20); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", 20);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", 10); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", 10);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ENCHANT_ITEM, "EnchantItem", 15);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", 5); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", 5);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", 1); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", 1);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", 10); loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", 10);

View File

@ -53,8 +53,7 @@ public class RequestEnchantItem implements ClientPacket
@Override @Override
public void run(GameClient client) public void run(GameClient client)
{ {
// TODO: canEnchantItem if (!client.getFloodProtectors().canEnchantItem())
if (!client.getFloodProtectors().canPerformTransaction())
{ {
return; return;
} }

View File

@ -32,6 +32,7 @@ public class FloodProtectors
private final FloodProtectorAction _globalChat; private final FloodProtectorAction _globalChat;
private final FloodProtectorAction _subclass; private final FloodProtectorAction _subclass;
private final FloodProtectorAction _dropItem; private final FloodProtectorAction _dropItem;
private final FloodProtectorAction _enchantItem;
private final FloodProtectorAction _serverBypass; private final FloodProtectorAction _serverBypass;
private final FloodProtectorAction _multiSell; private final FloodProtectorAction _multiSell;
private final FloodProtectorAction _transaction; private final FloodProtectorAction _transaction;
@ -55,6 +56,7 @@ public class FloodProtectors
_globalChat = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_GLOBAL_CHAT); _globalChat = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_GLOBAL_CHAT);
_subclass = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_SUBCLASS); _subclass = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_SUBCLASS);
_dropItem = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_DROP_ITEM); _dropItem = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_DROP_ITEM);
_enchantItem = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_ENCHANT_ITEM);
_serverBypass = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_SERVER_BYPASS); _serverBypass = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_SERVER_BYPASS);
_multiSell = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_MULTISELL); _multiSell = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_MULTISELL);
_transaction = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_TRANSACTION); _transaction = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_TRANSACTION);
@ -100,6 +102,11 @@ public class FloodProtectors
return _dropItem.canPerformAction(); return _dropItem.canPerformAction();
} }
public boolean canEnchantItem()
{
return _enchantItem.canPerformAction();
}
public boolean canUseServerBypass() public boolean canUseServerBypass()
{ {
return _serverBypass.canPerformAction(); return _serverBypass.canPerformAction();