[Guide] Autopatch server explained

09/06/2008 04:32 Rechocto#31
Quote:
Originally Posted by MushyPeas View Post
Well yea but thats because it's an ftp server, the autopatcher can't change an ftp server into a http server either :p but it can work with either one as far as I know.
But sending "READY" back to the client, still doesn't work, it still asks you to retry, manual patch, or bypass

Code:
Private Sub Form_Load()
Ws(0).Listen
End Sub

Private Sub Ws_Close(Index As Integer)
Me.Caption = "NotConnected"
End Sub

Private Sub Ws_Connect(Index As Integer)
Me.Caption = "Connected!"
End Sub

Private Sub Ws_ConnectionRequest(Index As Integer, ByVal requestID As Long)
Dim i As Integer
i = Ws.Count
Load Ws(i)
Ws(i).Accept requestID
End Sub

Private Sub Ws_DataArrival(Index As Integer, ByVal bytesTotal As Long)
On Error Resume Next
Dim s As String
If bytesTotal > 0 Then
Ws(Index).GetData s
Text1.Text = Text1.Text & "GET: " & s & vbCrLf
If InStr(s, "1000") <> 0 Then
 Ws(Index).SendData "READY" & vbCrLf
 Text1.Text = Text1.Text & "SEND: READY" & vbCrLf
End If
End If
End Sub
09/06/2008 05:08 nTL3fTy#32
As said before, just send "READY", "UPDATE [ip] [path]", or "FAIL".
I have fully tested this and routed their autopatch client to download from my FTP server. It works.
09/06/2008 05:13 Rechocto#33
I am just sending READY, a CrLf (end of a line) is like an EOF for a socket send, VB doesn't automatically add it to the send like C\C++ (and C#?) does

(kept hitting retry:)

Quote:
GET: 1000
SEND: READY
GET: 1000
SEND: READY
GET: 1000
SEND: READY
09/06/2008 10:05 YukiXian#34
Well, It doesn't work... !
09/06/2008 10:46 Rechocto#35
Well it works now, atleast the "READY" part does..


I send "UPDATE <MY IP> updates01.exe" but it doesnt download ftp://<MY IP>/updates01.exe, it jsut sends its version to to AutoPatch server again..
09/06/2008 20:55 YukiXian#36
Quote:
Originally Posted by Rechocto View Post
Well it works now, atleast the "READY" part does..


I send "UPDATE <MY IP> updates01.exe" but it doesnt download ftp://<MY IP>/updates01.exe, it jsut sends its version to to AutoPatch server again..
So it doesn't work :p
09/06/2008 22:51 nTL3fTy#37
Quote:
Originally Posted by YukiXian View Post
So it doesn't work :p
It works.
09/06/2008 22:58 MushyPeas#38
Quote:
Originally Posted by Rechocto View Post
Well it works now, atleast the "READY" part does..


I send "UPDATE <MY IP> updates01.exe" but it doesnt download ftp://<MY IP>/updates01.exe, it jsut sends its version to to AutoPatch server again..
Try monitoring your packets with WPE Pro or Wireshark (Ethereal) and see if theres anything wrong with them.

A thing you should take into consideration if you're on a shared hosting plan, the server's IP is shared between several other accounts, you will have to use your domain name instead of the IP, but again, this is only if you're on a shared hosting plan at a webhost.

You can also try putting an official patch (like 5060) on your server and see if that downloads or not.
09/07/2008 07:21 Rechocto#39
I'm hosting off my own computer, my ftp server is working fine, and the only file in the folder that the ftp server is broadcasting is "updates01.exe", I sent "UPDATE 210.124.128.205 updates01.exe" and it doesn't update...

Code:
Private Sub Ws_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim s As String, i As Integer, strdata As String, u As String, ui As Integer, ii As Integer
Open App.path & "version.txt" For Input As #1
Input #1, s
Close #1
s = Trim(s)
i = s
Ws(Index).GetData strdata
strdata = Trim(strdata)
'''''''''''''''''''''''
        'Ws(Index).SendData "READY"
        'Text1.Text = Text1.Text & "SEND: READY" & vbCrLf
        'Exit Sub
'''''''''''''''''''''''
If Len(strdata) > 3 Then
    ii = strdata
    Text1.Text = Text1.Text & "RECV: " & ii & vbCrLf
    If i = ii Then
        Ws(Index).SendData "READY"
        Text1.Text = Text1.Text & "SEND: READY" & vbCrLf
    Else
        ui = ii - 999
        If ui > 9 Then u = "updates" & ui & ".exe" Else: u = "updates0" & ui & ".exe"
        Ws(Index).SendData "UPDATE 210.124.128.205 " & u
        Text1.Text = Text1.Text & "SENT: UPDATE 210.124.128.205 " & u & vbCrLf
    End If
End If
End Sub
Quote:
RECV: 1000
SENT: UPDATE 210.124.128.205 updates01.exe

EDIT: Are we sure its using ftp on port 21?
09/07/2008 08:33 YukiXian#40
Quote:
Originally Posted by nTL3fTy View Post
It works.
Can you make Screeny's how to let it work? :)
Cuz I don't understand anything of this Guide....
09/07/2008 09:12 Rechocto#41
I tried using your example autopatch server on the first post, and even with that, it sends "UPDATE <MY IP> updates01.exe" but the client goes to "Autopatching..." but doesnt do anything, it just sits there... so it's gotta be something with my ftp server..

I connect to my ftp server anonymously from IE or Windows explorer and I can see updates01.exe right there, connecting from FF I don't see it though (FF wasn't exactly made to do ftp though, was it :P)

any advice?


EDIT:

up to now I've assumed it connects anonymously, should I add a specific username\password to my ftp server??
09/07/2008 14:05 MushyPeas#42
Quote:
Originally Posted by Rechocto View Post
I tried using your example autopatch server on the first post, and even with that, it sends "UPDATE <MY IP> updates01.exe" but the client goes to "Autopatching..." but doesnt do anything, it just sits there... so it's gotta be something with my ftp server..

I connect to my ftp server anonymously from IE or Windows explorer and I can see updates01.exe right there, connecting from FF I don't see it though (FF wasn't exactly made to do ftp though, was it :P)

any advice?


EDIT:

up to now I've assumed it connects anonymously, should I add a specific usernamepassword to my ftp server??
user: anonymous with any pass will work, did you try using one of TQ's official CO patches and see if those do get downloaded? 'cause if that's the case we should do some researching on that part.


Here's the full transcript of the ftp communication
Quote:
220---------- Welcome to Pure-FTPd ----------

220-You are user number 47 of 1000 allowed.

220-Local time is now 04:48. Server port: 21.

220-IPv6 connections are also welcome on this server.

220 You will be disconnected after 60 seconds of inactivity.

USER anonymous

230 Anonymous user logged in

PASS

230 Any password will work

TYPE I

200 TYPE is now 8-bit binary

PWD

257 "/" is your current location

CWD enzf

250 OK. Current directory is /enzf

SIZE 5060-5061.exe

213 808468

PASV

227 Entering Passive Mode (69,59,146,124,59,35)

RETR 5060-5061.exe

150-Accepted data connection

150 789.5 kbytes to download

226-File successfully transferred

226 3.417 seconds (measured here), 231.07 Kbytes per second
09/07/2008 14:51 Rechocto#43
Ah, thanks, it cwd's no matter what... :(.. I guess I'll just put a folder into the folder anonymous accesses.. however my FTP server isn't detecting it connecting so..... I have my ftp server broadcasting on port 21, you can view it going to ftp://teegeack.no-ip.org/


also, off topic
Quote:
Quote:
Originally Posted by leavemealone View Post
No matter what forum u use, its generally encrypted with MD5 and MD5 isn't exactly hard to decrypt
that's hillarious.
09/08/2008 14:06 porko2005#44
I think if someone adds a video guide it will make i easier
09/08/2008 15:28 YukiXian#45
Quote:
Originally Posted by porko2005 View Post
I think if someone adds a video guide it will make i easier
/Agree,