Menu

DCC Chat

Help
2003-05-30
2003-10-14
  • Matt Lehner

    Matt Lehner - 2003-05-30

    Hey,

    I started work on a DCC Chat system for smartirc, and so far going great. Right now I am just working on getting the bot to process the input from DCC. I just want to know the best place to put the code to process the input from DCC. Right now it's just a function that grabs the most recent info. I was looking to put it in _rawreceive() but wasn't sure if that would be the BEST place.

    Matt

     
    • Matt Lehner

      Matt Lehner - 2003-05-30

      Quick Update: I have attempted to put the receive function in _rawreceive(). Works but does not work. When I say something in the channel it checks the socket, otherwise it doesn't. Any suggestions on how to get this working right?

       
    • Mirco Bauer

      Mirco Bauer - 2003-05-30

      don't put it in the core API of SmartIRC, its breaks easily. Use the message handler API, its that messagehandler.php files, when you define your own handlering don't add the leading "_" like I am doing, that shows that its from original SmartIRC, so when version is updating its easy to copy the own defined messagehandler functions..
      like _mode() can co-exists with mode()
      both will be processed...

       
    • Matt Lehner

      Matt Lehner - 2003-05-30

      I was thinking to do that. But the message handler handles chat on the main IRC socket, and DCC uses it's own socket. Maybe I am wrong, and messagehandler would work, I don't get how it would work though.

       
    • Matt Lehner

      Matt Lehner - 2003-05-30

      here is the part of the code I am trying to get working right:

      foreach ($dccfp as $key => $value)
      {
      dcc_rawrecieve($key);
      }

      ^^ That code I put in _rawrecieve

      function dcc_rawrecieve($id)
      {
      global $dccfp;
      $message = @fread($dccfp[$id], 10240);
      if ($message !== null && !empty($message))
      {
      dcc_rawsend($id, "You just said: ".$message);
      }
      }

      ^^ that is the beginning of that funcion, for testing.

       
    • Matt Lehner

      Matt Lehner - 2003-05-30

      I believe I got it working. I just made a timer to execute the function.

       
      • Mirco Bauer

        Mirco Bauer - 2003-05-31

        I dont know the DCC protocol very good but I think the connection initialition is done through IRC commands, the ports and the IP are sent through IRC. If this is the case then you have to do it in messagehandler like I said, and create the socket there and make the DCC session in the messagehandler, or call from there another function..

         
        • Matt Lehner

          Matt Lehner - 2003-05-31

          It's accually alot easier than I thought after I did some research. Once I finish all the functions I would be willing to share the code to anyone who wants to see it. Right now it can receive a DCC Chat request and connect, send text, and respond to text.

           
    • Nobody/Anonymous

      did you ever get anywhere with this dcc stuff? Asking because I'm thinking about writing something that handles dcc chats (more of a toy than anything serious)..

       
    • Mirco Bauer

      Mirco Bauer - 2003-10-14

      I was going to start adding DCC support but got sidetracked by C# :) Now I am working on a C# port of SmartIRC, I will maintain both versions though....

      you can upload your code and paste the link, then I may take a look at it and maybe it's usable enough for adding it to the CVS version... 0.6.0 is still in work :)

       

Log in to post a comment.