• Welcome to Valhalla Legends Archive.
 

[BNFTP] FTP download questions

Started by RealityRipple, September 14, 2006, 02:39 AM

Previous topic - Next topic

RealityRipple

Hi again everyone. I have a few questions about Bnet's File Transfer Protocol.
First off, I'm assuming it's over port 6112 as well, right? If it's not, that might be the solution to my problems.
Secondly, I took a packet log of my bot and diablo 1 connecting to it, and they look exactly the same to me:

2F 00 00 01 36 38 58 49 4C 54 52 44 00 00 00 00 00 00 00 00 00 00 00 00 00 4D 89 7E 99 CB C6 01 76 65 72 2D 49 58 38 36 2D 35 2E 6D 70 71 00


2F 00 00 01 36 38 58 49 4C 54 52 44 00 00 00 00 00 00 00 00 00 00 00 00 00 4D 89 7E 99 CB C6 01 76 65 72 2D 49 58 38 36 2D 34 2E 6D 70 71 00

yet I get absolutely no response after sending the request. Here's my code:

Public Sub SendFTPRequest(ByVal FileName As String, ByVal LocalFileTimeLow As Long, ByVal LocalFileTimeHigh As Long, Optional ByVal StartLoc As Long = 0, Optional ByVal BannerAd As Boolean = False, Optional ByVal BannerID As Long = 0, Optional ByVal BannerEXT As Long = 0)
    If wsFTP.State <> sckConnected Then
        RaiseEvent Error("Not connected to FTP Server!")
        Exit Sub
    End If
    wsFTP.SendData &H2
    With Packet
        .ClearOutbound
        .InsertWORD &H100
        .InsertDWORD ARCH_IX86
        .InsertDWORD GameToDWORD(Config.Game)
        .InsertDWORD BannerID
        .InsertDWORD BannerEXT
        .InsertDWORD StartLoc
        .InsertDWORD LocalFileTimeHigh
        .InsertDWORD LocalFileTimeLow
        .InsertNTString FileName
        .SendFTPPacket wsFTP
    End With
End Sub

Can someone explain why it just sits there after it's sent, please?

RealityRipple

#1
Stupid mistake, sorry. It should be Chr$(&H2), not just &H2. Just one question, though... Isn't bnet supposed to close the connection when it's done? I recieve files, but they seem to be corrupt, and the connection doesn't get terminated....

Ersan


RealityRipple

The mode doesn't matter. It is binary though. When I did a check (If FTPCurrent = FTPLength Then) and closed the file if that check was true, the downloads appear to be fine. But the connection does NOT terminate as bnetdocs says it should.