delayed kick by flood filter

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Vrvy
Posts: 13
Joined: 31 Jul 2006, 19:02

delayed kick by flood filter

Postby Vrvy » 21 Sep 2006, 13:37

As I understand, there is a delay of 10 seconds in kicking a user if he is flooding. Would it be possible to somehow set this to 0 seconds?

Users that are flooding can still make a mess in the time that takes for them to be kicked.

regards
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 22 Sep 2006, 06:21

Not for the moment. The reason is that before they are kicked or banned an admin message is sent, so the delay allows them to read it.
Lapo
--
gotoAndPlay()
...addicted to flash games
Vrvy
Posts: 13
Joined: 31 Jul 2006, 19:02

Postby Vrvy » 22 Sep 2006, 23:28

I will make a filter in an extension then.
SimpleSquid
Posts: 6
Joined: 27 Sep 2008, 23:34

Postby SimpleSquid » 04 Jan 2009, 08:08

I'm getting the same problem. I was wondering if there is a way around it in this version?
sstark
Posts: 77
Joined: 21 Nov 2008, 16:06

Postby sstark » 05 Jan 2009, 16:22

there are setting in the server's config file for flood control.
SimpleSquid
Posts: 6
Joined: 27 Sep 2008, 23:34

Postby SimpleSquid » 08 Jan 2009, 01:57

Yes I am aware of that; however, there is a 10 second delay as Lapo has mentioned.
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 08 Jan 2009, 07:42

Is the delay a problem? Why?
Lapo

--

gotoAndPlay()

...addicted to flash games
SimpleSquid
Posts: 6
Joined: 27 Sep 2008, 23:34

Postby SimpleSquid » 12 Jan 2009, 02:03

The delay is a problem because it takes 10 seconds. During that time people who are spamming will fill up multiple pages of my chat application, before they are kicked.

Let me know if there is a solution within SFS.

Thanks Lapo.
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 12 Jan 2009, 07:14

Those ten seconds are necessary to send an admin message to the client.
If you have problems with people sending too big messages, you could limit the <MaxMsgLen> to lowerv value than the default (4096 = 4Kb)

Additionally you can perform minimal checks on your client side to prevent big messages to spam the chat box.
Lapo

--

gotoAndPlay()

...addicted to flash games
SimpleSquid
Posts: 6
Joined: 27 Sep 2008, 23:34

Postby SimpleSquid » 13 Jan 2009, 14:12

Hey Lapo,

I'm not having a problem with big messages; rather, it's small messages that users like to spam very quickly. For instance, they'll fill a page up with the letter "d" before they get kicked.

Anyway to fix this?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 13 Jan 2009, 15:58

If users log in with name and password ban them by name and also add their email to a black list. This way the next time they will try to recreate an account they won't be able to do it.

If you're allowing guest users you should think of removing this possibility.
Lapo

--

gotoAndPlay()

...addicted to flash games
no-one
Posts: 35
Joined: 01 Sep 2007, 16:42

Postby no-one » 14 Jan 2009, 17:49

just a sugestion but you could block the user from sending more messages once the kick delay starts, and once oyur at it its pretty easy to ad a custom length limit :

Code: Select all


private final static MAX_LENGTH =200;

public void init(){
   StaticObjects.zone.setPubMsgInternalEvent(true);
   StaticObjects.zone.setPrivMsgInternalEvent(true);
   

}
......

public void handleInternalEvent(InternalEventObject event) {
   if(event.getEventName().equalsIgnoreCase(event.EVENT_PUBLIC_MESSAGE)){
         
   String msg = event.getParam("msg");
   User u = (User) event.getObject("user");
   Room r = (Room) event.getObject("room");
         
   if(msg.length()>MAX_LENGTH)
      return;
         
   if(!u.isBeingKicked)
      StaticObjects.helper.dispatchPublicMessage(msg, r, u);
   }
      if(event.getEventName().equalsIgnoreCase(event.EVENT_PRIVATE_MESSAGE)){

         
   String msg = event.getParam("msg");
   User u = (User) event.getObject("user");
   Room r = (Room) event.getObject("room");
   User rc = (User) event.getObject("recipient");
         
   if(msg.length()>MAX_LENGTH)
      return;
         
   if(!u.isBeingKicked)
      StaticObjects.helper.dispatchPrivateMessage(msg, r, u, rc);
   }   
   
      
}
SimpleSquid
Posts: 6
Joined: 27 Sep 2008, 23:34

Postby SimpleSquid » 17 Jan 2009, 20:32

yeah, thanks for the code. I'll definitely check that out.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 40 guests