CIRCServer.onDCCSend Member
Syntax
object.onDCCSend(e);
Arguments
Argument | Summary |
---|---|
e |
Returns
Remarks
See Also
Source Code
function serv_dccsend (e)
{
var ary = e.DCCData.match(/([^ ]+) (\d+) (\d+) (\d+)/);
/* Just for mIRC: filenames with spaces may be enclosed in double-quotes.
* (though by default it replaces spaces with underscores, but we might as
* well cope). */
if ((ary[1][0] == '"') || (ary[1][ary[1].length - 1] == '"'))
ary = e.DCCData.match(/"(.+)" (\d+) (\d+) (\d+)/);
if (ary == null)
return false;
e.file = ary[1];
e.id = ary[2];
// Cheeky longword --> dotted IP conversion.
var host = Number(e.id).toString(16);
e.host = Number("0x" + host.substr(0, 2)) + "." +
Number("0x" + host.substr(2, 2)) + "." +
Number("0x" + host.substr(4, 2)) + "." +
Number("0x" + host.substr(6, 2));
e.port = Number(ary[3]);
e.size = Number(ary[4]);
e.destObject = e.replyTo;
e.set = (e.replyTo == e.user) ? "user" : "channel";
return true;
}