Browse Source

A couple of temporary flood protections

Sami 16 năm trước cách đây
mục cha
commit
8ccbf3dc1a

+ 14 - 0
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java

@@ -270,6 +270,13 @@ public final class L2VillageMasterInstance extends L2FolkInstance
                      * If the character is less than level 75 on any of their previously chosen
                      * classes then disallow them to change to their most recently added sub-class choice.
                      */
+                    
+                    if (!FloodProtector.getInstance().tryPerformAction(player.getObjectId(), FloodProtector.PROTECTED_SUBCLASS))
+                    {
+                    	_log.warning("Player "+player.getName()+" has performed a subclass change too fast");
+                    	return;
+                    }
+                    
                     if (player.getLevel() < 75)
                     {
                         player.sendMessage("You may not add a new sub class before you are level 75 on your previous class.");
@@ -420,6 +427,13 @@ public final class L2VillageMasterInstance extends L2FolkInstance
                      * Warning: the information about this subclass will be removed from the
                      * subclass list even if false!
                      */
+                	
+                	if (!FloodProtector.getInstance().tryPerformAction(player.getObjectId(), FloodProtector.PROTECTED_SUBCLASS))
+                    {
+                    	_log.warning("Player "+player.getName()+" has performed a subclass change too fast");
+                    	return;
+                    }
+                	
                     if (player.modifySubClass(paramOne, paramTwo))
                     {
                     	player.stopAllEffects(); // all effects from old subclass stopped!