mIRC Home    About    Download    Register    News    Help

Print Thread
Binary data problem #94959 21/08/04 02:23 AM
Joined: Dec 2002
Posts: 24
L
Laban Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 24
What is wrong here?
The following alias is called by: var %temp $mts.send(something,something,lots of something else)

It seems that nothing is written to my binvars, I can't get any info out of them into @debug. What have I missed?

alias mts.send {
; Datachart:
; 10 command K 1-10
; 30 network N 11-40
; 90 chan C 41-130
; 500 data D 131-630
;
; KKKKKKKKKKNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
; CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
; DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
; DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
; DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
; DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
; DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

if (!$network) { bset -t &mts.network 30 $server }
else { bset -t &mts.network 30 $network }

bset -t &mts.chan 90 $2
bset -t &mts.data 500 $3-

bset -t &data 640 $1
bcopy &data 11 &mts.network 1 30
bcopy &data 31 &mts.chan 1 90
bcopy &data 131 &mts.data 1 500

aline @debug $timestamp 11-> $bvar(&data,0) bytes
; var %i $compress(&data,b)
; aline @debug $timestamp 11-> $bvar(&data,0) bytes

; sockwrite -b mtd $bvar(&data,0) &data

aline @debug $timestamp 04> $bvar(&data,1,$bvar(&data,0)).text
return $true
}

Result:
[04:21:05] -> 643 bytes
[04:21:05] >
End of result.

The sockwrite is commented out until this problem is solved. It would be kinda pointless to send a bunch of empty data wouldn't it?


!ERAU QSSI DLRO WEHT
Re: Binary data problem #94960 21/08/04 10:50 AM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
It doesnt work because, very simply,
bset -t &data 640 $1
The variable DOESNT exist, and you are writing $1 to the
640th Byte, which tells mIRC to zero-fill from 1-639 (with 0's).

And, low and behold, mIRCs $bvar().text reads up to the first
zero character and not beyond, hence why theres no text,
because the first character is a zero.

Eamonn.