Selaa lähdekoodia

Add separated config for manufacture and manor floodprotection.

_DS_ 15 vuotta sitten
vanhempi
sitoutus
0d9934a29d

+ 8 - 0
L2_GameServer/java/com/l2jserver/Config.java

@@ -577,6 +577,8 @@ public final class Config
 	public static FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS;
 	public static FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL;
 	public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION;
+	public static FloodProtectorConfig FLOOD_PROTECTOR_MANUFACTURE;
+	public static FloodProtectorConfig FLOOD_PROTECTOR_MANOR;
 	public static FloodProtectorConfig FLOOD_PROTECTOR_SENDMAIL;
 	public static FloodProtectorConfig FLOOD_PROTECTOR_CHARACTER_SELECT;
 
@@ -993,6 +995,10 @@ public final class Config
 				new FloodProtectorConfig("MultiSellFloodProtector");
 			FLOOD_PROTECTOR_TRANSACTION =
 				new FloodProtectorConfig("TransactionFloodProtector");
+			FLOOD_PROTECTOR_MANUFACTURE =
+				new FloodProtectorConfig("ManufactureFloodProtector");
+			FLOOD_PROTECTOR_MANOR =
+				new FloodProtectorConfig("ManorFloodProtector");
 			FLOOD_PROTECTOR_SENDMAIL =
 				new FloodProtectorConfig("SendMailFloodProtector");
 			FLOOD_PROTECTOR_CHARACTER_SELECT =
@@ -3005,6 +3011,8 @@ public final class Config
 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5");
 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", "1");
 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", "10");
+		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANUFACTURE, "Manufacture", "3");
+		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANOR, "Manor", "30");
 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SENDMAIL, "SendMail", "100");
 		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_CHARACTER_SELECT, "CharacterSelect", "30");
 	}

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestBuyProcure.java

@@ -75,7 +75,7 @@ public class RequestBuyProcure extends L2GameClientPacket {
 		if (player == null)
 			return;
 
-		if (!getClient().getFloodProtectors().getTransaction().tryPerformAction("buy"))
+		if (!getClient().getFloodProtectors().getManor().tryPerformAction("BuyProcure"))
 			return;
 
 		if(_items == null)

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestBuySeed.java

@@ -94,7 +94,7 @@ public class RequestBuySeed extends L2GameClientPacket
 		if (player == null)
 			return;
 
-		if (!getClient().getFloodProtectors().getTransaction().tryPerformAction("buy"))
+		if (!getClient().getFloodProtectors().getManor().tryPerformAction("BuySeed"))
 			return;
 
 		if (_seeds == null)

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestRecipeItemMakeSelf.java

@@ -40,7 +40,7 @@ public final class RequestRecipeItemMakeSelf extends L2GameClientPacket
 		if (activeChar == null)
 			return;
 
-    	if (!getClient().getFloodProtectors().getTransaction().tryPerformAction("RecipeMake"))
+    	if (!getClient().getFloodProtectors().getManufacture().tryPerformAction("RecipeMakeSelf"))
     		return;
 
 		if (activeChar.getPrivateStoreType() != 0)

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java

@@ -47,7 +47,7 @@ public final class RequestRecipeShopMakeItem extends L2GameClientPacket
 		if (activeChar == null)
 			return;
 
-		if (!getClient().getFloodProtectors().getTransaction().tryPerformAction("RecipeShopMake"))
+		if (!getClient().getFloodProtectors().getManufacture().tryPerformAction("RecipeShopMake"))
     		return;
 
     	L2PcInstance manufacturer = L2World.getInstance().getPlayer(_id);

+ 30 - 0
L2_GameServer/java/com/l2jserver/gameserver/util/FloodProtectors.java

@@ -67,6 +67,14 @@ public final class FloodProtectors
 	 * Transaction flood protector.
 	 */
 	private final FloodProtectorAction _transaction;
+	/**
+	 * Manufacture flood protector.
+	 */
+	private final FloodProtectorAction _manufacture;
+	/**
+	 * Manor flood protector.
+	 */
+	private final FloodProtectorAction _manor;
 	/**
 	 * Send mail flood protector.
 	 */
@@ -96,6 +104,8 @@ public final class FloodProtectors
 		_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);
+		_manufacture = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_MANUFACTURE);
+		_manor = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_MANOR);
 		_sendMail = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_SENDMAIL);
 		_characterSelect = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_CHARACTER_SELECT);
 	}
@@ -210,6 +220,26 @@ public final class FloodProtectors
 		return _transaction;
 	}
 
+	/**
+	 * Returns {@link #_manufacture}.
+	 * 
+	 * @return {@link #_manufacture}
+	 */
+	public FloodProtectorAction getManufacture()
+	{
+		return _manufacture;
+	}
+
+	/**
+	 * Returns {@link #_manor}.
+	 * 
+	 * @return {@link #_manor}
+	 */
+	public FloodProtectorAction getManor()
+	{
+		return _manor;
+	}
+
 	/**
 	 * Returns {@link #_sendMail}.
 	 * 

+ 14 - 0
L2_GameServer/java/config/floodprotector.properties

@@ -85,6 +85,20 @@ FloodProtectorTransactionPunishmentLimit = 0
 FloodProtectorTransactionPunishmentType = none
 FloodProtectorTransactionPunishmentTime = 0
 
+# Manufacture
+FloodProtectorManufactureInterval = 3
+FloodProtectorManufactureLogFlooding = False
+FloodProtectorManufacturePunishmentLimit = 0
+FloodProtectorManufacturePunishmentType = none
+FloodProtectorManufacturePunishmentTime = 0
+
+# Manor
+FloodProtectorManorInterval = 30
+FloodProtectorManorLogFlooding = False
+FloodProtectorManorPunishmentLimit = 0
+FloodProtectorManorPunishmentType = none
+FloodProtectorManorPunishmentTime = 0
+
 # SendMail - sending mail interval, 10s on retail
 FloodProtectorSendMailInterval = 100
 FloodProtectorSendMailLogFlooding = False