Jump to content

Recommended Posts

Posted

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.

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

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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock