Skip to content

[Guide][Share][Java] FloodProtection Rework. Important !

Featured Replies

Hello MxC, i would like to share Flood Protection rework, this will help you avoid some bugs, spams, lags.

 

This is for Interlude, Gracia final already has it.

 

The first thing you have to is to delete old Floodprotections Is so easy, look a bit:

 

Delete floodprotector.java, after delete all the errors comes up from this delete :P. Delete Support from L2Pcinstance.

 

Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
+++ /trunk/Eclipse/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
@@ -201,5 +201,4 @@
import net.sf.l2j.gameserver.templates.L2WeaponType;
import net.sf.l2j.gameserver.util.Broadcast;
-import net.sf.l2j.gameserver.util.FloodProtector;
import net.sf.l2j.util.Point3D;
import net.sf.l2j.util.Rnd;
@@ -10883,6 +10883,5 @@
			// Close the connection with the client
			closeNetConnection();
-			// remove from flood protector
-			FloodProtector.getInstance().removePlayer(getObjectId());
+			
			if (getClanId() > 0)
			{

 

Then add the new FloodProtection System, look again:

 

Take this file: FloodProtection Rework

 

is a diff file, is the rework for FloodProtection ( is too easy to add by hand )

 

Then after all these, you will have to add the protection in the files you want to protect:

Here is an example:

 

Index: /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
===================================================================
--- /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 421)
+++ /trunk/Eclipse/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 423)
@@ -17,4 +17,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+
+import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;

import net.sf.l2j.Config;
@@ -60,4 +62,11 @@
	{
		L2PcInstance activeChar = getClient().getActiveChar();
+		
+		if (!activeChar.getFloodProtectors().getServerBypass().tryPerformAction("_command"))
+		{
+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
+			return;
+		}
+		
		if (activeChar == null)

NOTE: "Actionfailed.STATIC_PACKET " can be changed to new ActionFaled()); without harming the code.
		{

 

Here is the link for all important: http://www.4shared.com/file/184891519/dbc74782/Protectingit.html

 

Note: This is important for all Interlude Servers.

Hidded for 200 Posts, because is unique. And Useful for all Interlude Servers.

yes but better edit your first post no make double post btw thanks system ;)
  • Author

yes but better edit your first post no make double post btw thanks system ;)

Hehehehe, I know :P Thank you

  • 3 weeks later...
  • 4 weeks later...

Link is dead, can you reupload it ? Cheers.

Link is dead, can you reupload it ? Cheers.

 

the guy is banned from using this forum

Auch.... Anyways i got a source from the other link, maybe someone can tell me how to add an patch.diff to eclipse? Any help will be appreciated!

 

 

OK i figured it out!

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.