Menu

Kick Protection

Help
Anonymous
2004-09-22
2013-04-09
  • Anonymous

    Anonymous - 2004-09-22

    Hi there! I want to make some sort of kick protection. If a user tries to kick "TestNick" the bot should check TestNick's ident and host, and decide afterwards whether he kicks TestNick...
    The problem is that I do not know how to get the ident / the host of the person who is tried to be kicked. With $data->ident you just get the ident of the kicking person (as known ;)) Can anyone tell me how I can get his or her nick?

     
    • Mirco Bauer

      Mirco Bauer - 2004-09-22

      this you can do very easily with the smartirc channel sync feature: first $irc->setChannelSync(true); then do in your kick actionhandler:
      // this gets the user object of the current channel (where the kick command was sent to)
      $user = $irc->getUser($data->channel, 'TestNick');
      echo $user->ident;
      echo $user->host;

      note: you need the CVS HEAD version of SmartIRC todo this... get it from http://cvs.php.net/co.php/pear/Net_SmartIRC/ on this forum there is a topic what you need to download...

       
    • Anonymous

      Anonymous - 2004-09-24

      Hmm, I replaced SmartIRC.php and the files of the SmartIRC folder. Now I get an "Fatal error: Call to undefined function: getchannel() in .../messagehandler.php on line 419"

      It occurs right when the bot starts up and enters a channel. Can you help me with this?

       
      • Mirco Bauer

        Mirco Bauer - 2004-09-24

        you didnt update the other files like SmartIRC/defines.php SmartIRC/messagehandler.php SmartIRC/irccommands.php
        read the forum post howto update to CVS HEAD (btw I made yester 2 commits, so please redownload)
        http://sourceforge.net/forum/forum.php?thread_id=878187&forum_id=204500

         
        • Anonymous

          Anonymous - 2004-09-25

          Now I used SmartIRC.php 1.85 instead of 1.54.2.12. It works now, thanks!

           

Log in to post a comment.