Login
...or Sign up
Home
Search
Search Code Snippets
Search People
Lolwtf
# Check if this is an ACK Message # TODO : Actually check if the ACK is good ? check size and all that crap... if { $cMsgSize == 0 } { # Let us check if any of our sessions is waiting for an ACK set sid [SessionList findid $cAckId] status_log "GOT SID : $sid for Ackid : $cAckId\n" if { $sid != -1 } { set type [lindex [SessionList get $sid] 7] #status_log "TYPE of SID : $type" if { $cFlags == 2 } { #status_log "MSNP2P | $sid -> Got MSNP2P ACK " red if {$type == "game"} { ::MSNGames::handleACK $sid $cAckId return } # We found a session id that is waiting for an ACK set step [lindex [SessionList get $sid] 4] # Just these 2 for now, will probably need more with file transfers switch $step { DATAPREP { # Set the right variables, prepare to send data after next ack SessionList set $sid [list -1 4 0 -1 "SENDDATA" -1 -1 -1 -1 -1] # We need to send a data preparation message SendPacket [::MSN::SBFor $chatid] [MakePacket $sid [binary format i 0]] status_log "MSNP2P | $sid -> Sent DATA Preparation\n" red } SENDDATA { #status_log "MSNP2P | $sid -> Sending DATA now\n" red set file [lindex [SessionList get $sid] 8] if { $file != "" } { SendData $sid $chatid "[lindex [SessionList get $sid] 8]" } else { SendData $sid $chatid "[::skin::GetSkinFile displaypic [PathRelToAbs [::config::getKey displaypic]]]" } } DATASENT { SessionList set $sid [list -1 -1 0 -1 "BYE" -1 -1 -1 -1 -1] #status_log "MSNP2P | $sid -> Got ACK for sending data, now sending BYE\n" red set branchid "[format %X [myRand 4369 65450]][format %X [myRand 4369 65450]]-[format %X [myRand 4369 65450]]-[format %X [myRand 4369 65450]]-[format %X [myRand 4369 65450]]-[format %X [myRand 4369 65450]][format %X [myRand 4369 65450]][format %X [myRand 4369 65450]]" SendPacket [::MSN::SBFor $chatid] [MakePacket $sid [MakeMSNSLP "BYE" [lindex [SessionList get $sid] 3] [::config::getKey login] "$branchid" "0" [lindex [SessionList get $sid] 5] 0 0] 1] } BYE { SessionList unset $sid }
Score: 0/10
Would you like to comment?
Sign up
for a free account or
sign in
(if you are already a member).
URL:
Embed:
Uploaded on 4/23/2010 1:33:02 PM
by
Carnis
Programming Language:
Tags:
Viewed 95 times
Help
Help by email
What is Naslu?
|
About Naslu
|
Contact
|
Terms of Use
|
Downloads
|
Webprogramacion.com
|
Blog
|
Top
Links
Select language:
Español
|
English
© 2009 naslu.com