Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: RealityRipple on September 14, 2006, 02:39 AM

Title: [BNFTP] FTP download questions
Post by: RealityRipple on September 14, 2006, 02:39 AM
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?
Title: Re: [BNFTP] FTP download questions
Post by: RealityRipple on September 14, 2006, 02:53 AM
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....
Title: Re: [BNFTP] FTP download questions
Post by: Ersan on September 14, 2006, 03:18 AM
ASCII vs. Binary mode?
Title: Re: [BNFTP] FTP download questions
Post by: RealityRipple on September 14, 2006, 03:21 AM
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.