mIRC Home    About    Download    Register    News    Help

Print Thread
#152034 25/06/06 09:13 PM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
Hey.

Iam currently working on a script which will support DCC on sockets that will be opend by mIRC to an IRC-server.

But Iam kind of stuck when it comes to the file-transfers (receiving, not sending). It connects and it also reads/writes to the file but the problems are:

1 - It doesnt send information back to the server so the progressbar for the client(server) which is sending does not update (it doesnt send information back because I do not know what to send back
2 - All the files get corrupted (it writes everything it gets from the socket to the file with /bwrite)

Thank you in advance.

Last edited by whatsthedillio; 25/06/06 09:20 PM.
#152035 26/06/06 08:05 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
You dont dcc send/rercieve through the irc server tho!

PS: from mempry the reciever of the file is ment to send back acknoldge messages that i think are the amount of file recieved, might be in bigended order, but would have to check, its somewhere in the mirc help file from memory.

#152036 26/06/06 08:38 PM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
Since the connection is made between 2 computers, one of them needs to be the server. I was refering to this server(which is the person who requests the send to the person and thus listens), and not the IRC-server.

Ok, I found out what to send back exactly. I need to send a package back to the person that is sending in a network-byte format, which can be converted with $bvar and it's "nlong" property. Could someone give me an proper example of how to convert an integer to network-byte format. I tried and did not succeed.

Thank you in advance~

Last edited by whatsthedillio; 26/06/06 08:43 PM.
#152037 27/06/06 07:15 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
re: IRC-server
Well you said irc server not me. smile~


re: the rest
Network byte order is simiply the order in which bytes of a larger value occur, its also called Bigendien (Most significatnt byte first to least significant byte last)
FYI the x86 processors use LSB to MSB order (the opersite)

Simply put , take a value and convert it to its equivilant 4 byte binary value, then order the bytes with the most significant byte first

examples
7 = 0 0 0 7 = 0 x 256^3 + 0 x 256^2 + 0 x 256 + 7
1678052209 = 100 5 11 113 = 100 x 256^3 + 5 x 256^2 + 11 x 256 + 113

The order shown here is the order they need to be transmitted in.

Hope this helps.

#152038 27/06/06 08:15 AM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
This all seems like a riddle to me XD

Quote:
1678052209 = 100 5 11 113

Could you explain how you got those numbers from that value with a mirc-script?

Thanks.

#152039 27/06/06 04:44 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I think you use $longip

Quote:

$longip(address)
Converts an IP address into a long value and vice-versa.

$longip(158.152.50.239) returns 2660774639
$longip(2660774639) returns 158.152.50.239


#152040 28/06/06 06:48 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I did show u "1678052209 = 100 5 11 113 = 100 x 256^3 + 5 x 256^2 + 11 x 256 + 113"

do u not know what 256^3 means?

1678052209 = (100 x 256 x 256 x 256) + (5 x 256 x 256) + (11 x 256) + (113)

Mikechat uses a clever method of getting them, which is infact exactly what an ip x.x.x.x is a big number broken into bigendien order with dots between it.

/bset &binvar 1 $replace($longip(1678052209),.,$chr(32))


Link Copied to Clipboard