Addition of AugmentScript and EnchantItem flood protectors.
This commit is contained in:
		@@ -71,6 +71,13 @@ FloodProtectorDropItemPunishmentLimit = 0
 | 
			
		||||
FloodProtectorDropItemPunishmentType = none
 | 
			
		||||
FloodProtectorDropItemPunishmentTime = 0
 | 
			
		||||
 | 
			
		||||
# EnchantItem - flooding
 | 
			
		||||
FloodProtectorEnchantItemInterval = 15
 | 
			
		||||
FloodProtectorEnchantItemLogFlooding = False
 | 
			
		||||
FloodProtectorEnchantItemPunishmentLimit = 0
 | 
			
		||||
FloodProtectorEnchantItemPunishmentType = none
 | 
			
		||||
FloodProtectorEnchantItemPunishmentTime = 0
 | 
			
		||||
 | 
			
		||||
# ServerBypass - server bypass flooding
 | 
			
		||||
FloodProtectorServerBypassInterval = 5
 | 
			
		||||
FloodProtectorServerBypassLogFlooding = False
 | 
			
		||||
@@ -80,7 +80,7 @@ public class Config
 | 
			
		||||
	private static final String SEVENSIGNS_CONFIG_FILE = "./config/main/SevenSigns.ini";
 | 
			
		||||
	public static final String SIEGE_CONFIG_FILE = "./config/main/Siege.ini";
 | 
			
		||||
	// protected
 | 
			
		||||
	private static final String PROTECT_FLOOD_CONFIG_FILE = "./config/protected/Flood.ini";
 | 
			
		||||
	private static final String PROTECT_FLOOD_CONFIG_FILE = "./config/protected/FloodProtector.ini";
 | 
			
		||||
	private static final String PROTECT_OTHER_CONFIG_FILE = "./config/protected/Other.ini";
 | 
			
		||||
	public static final String TELNET_CONFIG_FILE = "./config/protected/Telnet.ini";
 | 
			
		||||
	// events
 | 
			
		||||
@@ -772,6 +772,7 @@ public class Config
 | 
			
		||||
	public static FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT;
 | 
			
		||||
	public static FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS;
 | 
			
		||||
	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_MULTISELL;
 | 
			
		||||
	public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION;
 | 
			
		||||
@@ -2209,6 +2210,7 @@ public class Config
 | 
			
		||||
		FLOOD_PROTECTOR_GLOBAL_CHAT = new FloodProtectorConfig("GlobalChatFloodProtector");
 | 
			
		||||
		FLOOD_PROTECTOR_SUBCLASS = new FloodProtectorConfig("SubclassFloodProtector");
 | 
			
		||||
		FLOOD_PROTECTOR_DROP_ITEM = new FloodProtectorConfig("DropItemFloodProtector");
 | 
			
		||||
		FLOOD_PROTECTOR_ENCHANT_ITEM = new FloodProtectorConfig("EnchantItemFloodProtector");
 | 
			
		||||
		FLOOD_PROTECTOR_SERVER_BYPASS = new FloodProtectorConfig("ServerBypassFloodProtector");
 | 
			
		||||
		FLOOD_PROTECTOR_MULTISELL = new FloodProtectorConfig("MultiSellFloodProtector");
 | 
			
		||||
		FLOOD_PROTECTOR_TRANSACTION = new FloodProtectorConfig("TransactionFloodProtector");
 | 
			
		||||
@@ -2903,6 +2905,7 @@ public class Config
 | 
			
		||||
		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", 5);
 | 
			
		||||
		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", 20);
 | 
			
		||||
		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_MULTISELL, "MultiSell", 1);
 | 
			
		||||
		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", 10);
 | 
			
		||||
 
 | 
			
		||||
@@ -123,6 +123,12 @@ public class RequestEnchantItem implements IClientIncomingPacket
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		// Flood protect to enchant script
 | 
			
		||||
		if (!client.getFloodProtectors().getEnchantItem().tryPerformAction("enchant"))
 | 
			
		||||
		{
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		if (player.getActiveTradeList() != null)
 | 
			
		||||
		{
 | 
			
		||||
			player.cancelActiveTrade();
 | 
			
		||||
 
 | 
			
		||||
@@ -57,6 +57,10 @@ public class FloodProtectors
 | 
			
		||||
	 * Drop-item flood protector.
 | 
			
		||||
	 */
 | 
			
		||||
	private final FloodProtectorAction _dropItem;
 | 
			
		||||
	/**
 | 
			
		||||
	 * enchantItem flood protector.
 | 
			
		||||
	 */
 | 
			
		||||
	private final FloodProtectorAction _enchantItem;
 | 
			
		||||
	/**
 | 
			
		||||
	 * Server-bypass flood protector.
 | 
			
		||||
	 */
 | 
			
		||||
@@ -125,6 +129,7 @@ public class FloodProtectors
 | 
			
		||||
		_globalChat = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_GLOBAL_CHAT);
 | 
			
		||||
		_subclass = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_SUBCLASS);
 | 
			
		||||
		_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);
 | 
			
		||||
		_multiSell = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_MULTISELL);
 | 
			
		||||
		_transaction = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_TRANSACTION);
 | 
			
		||||
@@ -212,6 +217,15 @@ public class FloodProtectors
 | 
			
		||||
		return _dropItem;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Returns {@link #_enchantItem}.
 | 
			
		||||
	 * @return {@link #_enchantItem}
 | 
			
		||||
	 */
 | 
			
		||||
	public FloodProtectorAction getEnchantItem()
 | 
			
		||||
	{
 | 
			
		||||
		return _enchantItem;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Returns {@link #_serverBypass}.
 | 
			
		||||
	 * @return {@link #_serverBypass}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user