• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Annoying flood problem !

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
7 posts • Page 1 of 1

Postby wanted » Fri Dec 09, 2011 9:55 am

Hey

My problem is simple : when you stay pushed on the "enter" button by accident you get banned from the room almost instantly.
I have this chat plugin installed and I dont know if you already got banned because of this but personnally yes, too many times, and some of my visitors also then i can't keep it like this (note that you can see also this bug in the demo chat).

I talked to someone on the demo chat here on this website, he told me to check around pfcclient.js but i dont know anything about javascript (only php for me).

If someone got ideas... Thanks
Last edited by wanted on Fri Dec 09, 2011 10:52 am, edited 1 time in total.
wanted
New member
 
Posts: 7
Joined: Fri Dec 09, 2011 9:48 am
Top

Postby re*s.t.a.r.s.*2 » Fri Dec 09, 2011 2:35 pm

hi,

When I am in the demo I see no problems with noflood, people writes and enjoy the demo correctly..

can you elaborate how to reproduce this behavior?

regards.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby DaNGuS » Fri Dec 09, 2011 6:04 pm

go to the src/pfcglobalconfig.class.php

finde this


"noflood" => array("charlimit" => 4500,
"msglimit" => 2,
"delay" => 5),

thats your flood setings, change msglimit to bige number, then you will not get flood kicks anymore
DaNGuS
Member
 
Posts: 20
Joined: Fri Nov 11, 2011 9:33 am
Top

Postby re*s.t.a.r.s.*2 » Fri Dec 09, 2011 10:31 pm

Hi,

DaNGus

Al thought we appreciate your help, please stop telling people to changing core php documents in the
script, because they can do it directly with $params array.

read the http://www.phpfreechat.net/parameters please to understand better of what I am talking about.

regards.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby wanted » Sat Dec 10, 2011 4:49 am

You all seems to not really understand my problem...

@DaNGuS: I don't need to change the $params because the default parameters are just perfect for me. and changing it won't help, I explain :
By default if im not wrong we have to send something like 10 messages in 5 seconds to be kicked but this is not exactly how it works in fact. The chat plugin just detect each time you push the "enter" key, and it count like a message even if you wrote nothing.

@re*s.t.a.r.s.*2: "can you elaborate how to reproduce this behavior?"
Very easy, just go to the chat, click in the area where you write and just press ENTER. Because of windows repeat the buttun when you stay pushed, the 10 flood messages will be sent very fast.

"When I am in the demo I see no problems with noflood, people writes and enjoy the demo correctly.."
Of course most of the people will enjoy the demo correctly, but what if someone stay pushed on enter after sent a message by accident ? And as i told in my first message, i had this problem and im not the only one on my chat to get it, i had to search a moment for find what make us ban like that. In fact it's like every bugs, not 100% of the people will find them...

"Al thought we appreciate your help, please stop telling people to changing core php documents in the
script, because they can do it directly with $params array. "
Well i'm ok with you if it's already in the variable $params but i dont think there is a $param like "block_enter_key_after_pushed", because this is exactly what i want.

When you send an empty message you get it : "Text cannot be empty" but it still count like a message. This is a bug for me, and i never found this bug anywhere else...
And sorry for my english, i know it's bad. I just hope your understand me.
Last edited by wanted on Sat Dec 10, 2011 5:19 am, edited 1 time in total.
wanted
New member
 
Posts: 7
Joined: Fri Dec 09, 2011 9:48 am
Top

Postby re*s.t.a.r.s.*2 » Sat Dec 10, 2011 7:30 am

Hi,

I 've managed to duplicate your report,

And I think this fixes it..

copy paste this code in "/src/proxies/nooflood.class.php" starting from line 44 highlight to line 93
Code: Select all
    $cmdtocheck = array("send", "nick", "me","notice");
    // fixes the count of noflood even if the text posted was empty (Neumann Valle (UTAN))
    if ( in_array($this->name, $cmdtocheck) && $param != "")
    {
      $container =& pfcContainer::Instance();
      $nickid        = $u->nickid;
      $isadmin       = $container->getUserMeta($nickid, 'isadmin');
      $lastfloodtime = $container->getUserMeta($nickid, 'floodtime');
      $flood_nbmsg   = $container->getUserMeta($nickid, 'flood_nbmsg');
      $flood_nbchar  = $container->getUserMeta($nickid, 'flood_nbchar');
      $floodtime     = time();

      if ($floodtime - $lastfloodtime <= $c->proxies_cfg[$this->proxyname]["delay"])
      {
        // update the number of posted message indicator
        $flood_nbmsg++;
        // update the number of posted characteres indicator
        $flood_nbchar += utf8_strlen($param);
      }
      else
      {
        $flood_nbmsg = 0;
        $flood_nbchar = 0;
      }
     
      if (!$isadmin &&
          ($flood_nbmsg>$c->proxies_cfg[$this->proxyname]["msglimit"] ||
           $flood_nbchar>$c->proxies_cfg[$this->proxyname]["charlimit"])
          )
      {
        // warn the flooder
        $msg = _pfc("Please don't post so many message, flood is not tolerated");
        $xml_reponse->script("alert('".addslashes($msg)."');");

        // kick the flooder
        $cmdp = $p;
        $cmdp["param"] = null;
        $cmdp["params"][0] = "ch";
        $cmdp["params"][1] = $u->channels[$recipientid]["name"];
        $cmdp["params"][2] .=_pfc("kicked from %s by %s", $u->channels[$recipientid]["name"], "noflood");
        $cmd =& pfcCommand::Factory("leave");
        $cmd->run($xml_reponse, $cmdp);
        return false;
      }

      if ($flood_nbmsg == 0)
        $container->setUserMeta($nickid, 'floodtime', $floodtime);
      $container->setUserMeta($nickid,   'flood_nbmsg',  $flood_nbmsg);
      $container->setUserMeta($nickid,   'flood_nbchar', $flood_nbchar);
    }

Please report back if worked..

regards.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby wanted » Mon Dec 12, 2011 4:10 am

It work fine ! thank you very much.
wanted
New member
 
Posts: 7
Joined: Fri Dec 09, 2011 9:48 am
Top


Post a reply
7 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 19 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub