You need 2 handlers
1 to handle CTCP
registerActionhandler(SMARTIRC_TYPE_CTCP, '/.*DCC
CHAT.*/', &$this, 'acceptConnection');
and the other to chech the sockets for data
registerTimehandler(750, &$this, 'checkSocket');
and have a method to process all your sends and have it pull
out DCC sends and pass them to your DCC module.
send method:
function sendMessage($Nick, $Message) {
// See if we have socket for this user
if(isset($this->_sessions[$Nick]))
{// User has open socket
$Result = socket_write($this->_sessions[$Nick]
['socket'], $Message."\r\n" , strlen($Message."\r\n"));
// Check for error
if($Result === false)
{// There was a error so destroy socket/session
socket_close($this->_sessions[$Nick]['socket']);
unset($this->_sessions[$Nick]);
}
}
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: NO
I second that, I'd love this feature.
Logged In: NO
Add DCC support as a module isn't that hard.
You just have to read up on how DCC works.
You need 2 handlers
1 to handle CTCP
registerActionhandler(SMARTIRC_TYPE_CTCP, '/.*DCC
CHAT.*/', &$this, 'acceptConnection');
and the other to chech the sockets for data
registerTimehandler(750, &$this, 'checkSocket');
and have a method to process all your sends and have it pull
out DCC sends and pass them to your DCC module.
send method:
function sendMessage($Nick, $Message) {
// See if we have socket for this user
if(isset($this->_sessions[$Nick]))
{// User has open socket
$Result = socket_write($this->_sessions[$Nick]
['socket'], $Message."\r\n" , strlen($Message."\r\n"));
// Check for error
if($Result === false)
{// There was a error so destroy socket/session
socket_close($this->_sessions[$Nick]['socket']);
unset($this->_sessions[$Nick]);
}
}
}