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!

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...