[Open Source] Patcher v3

01/26/2013 15:51 Sedrika#1
.
01/26/2013 18:29 Razzer'##2
Mir ist aufgefallen , dass dein MD5 Hash nicht richtig funktioniert.

Bei kleinen änderung an der Neuz , wo nur paar Bytes anders sind . Patcht er nicht die Neuz.
01/26/2013 18:32 Sedrika#3
Es wird auch nicht auf den MD5 Hash geprüft. Bei vielen Dateien wäre das langsam.
Es gibt ein Check auf Dateigröße in Byte und den letzen zugriff auf die Datei.
Noch ist die Patchlist nicht verschlüpsselt, daher kann man das in der list.txt selbst einsehen.

Warte noch etwas ab, ich pack dann MD5 als Zusatz (optional) check ein.
01/26/2013 18:49 tangia1426#4
HOW TO COMPILE THIS ONE?
01/26/2013 19:02 Sedrika#5
With Visual Basic 2010.
01/26/2013 21:49 xsrf#6
Sieht gut aus, wie immer :)
01/26/2013 21:51 Sedrika#7
Habe ebend den MD5 Check eingebaut und dabei ist mir ein Fehler beim Check der Dateien aufgefallen. Diesen habe ich in v3.0.1 behoben.

Download: [Only registered and activated users can see links. Click Here To Register...]
01/28/2013 11:46 jcdace#8
Sedrika?

There is a problem with this code.


If the person Is american, or uses the date format MM/DD/YYYY on their computer as opposed to DD/MM/YYYY.

It willl throw an exception and not change the dates of the files nor will it finish the patching.

I fixed it in a very hacky way

Code:
            Dim dateString, format As String
            Dim result As Date
            Dim provider As Globalization.CultureInfo = Globalization.CultureInfo.InvariantCulture

            ' Parse date and time with custom specifier.
            ' 20.01.2013 04:46:54

            dateString = Args(2)

            Dim strDate2 As String

            Try

                If Month("01-02-03") = 1 Then

                    strDate2 = DateTime.ParseExact(Args(2),
                                            "dd.MM.yyyy hh:mm:ss",
                                             provider).ToString("MM.dd.yyyy hh:mm:ss")

                    result = Date.ParseExact(strDate2, "MM.dd.yyyy hh:mm:ss", provider)
                Else
                    result = Date.ParseExact(Args(2), "dd.MM.yyyy hh:mm:ss", provider)
                End If

            Catch e As FormatException
                CFunc.Status("Error: Converting Date Failed!") ' Status setzem
            End Try

            Try
                File.SetLastWriteTime(Args(0).Remove(Args(0).Length - 3), result)
            Catch e As FormatException
                CFunc.Status("Error: SetLastWriteTime Failed!") ' Status setzem
            End Try
I hope this helps
01/28/2013 12:04 Sedrika#9
Why did not you just changed the PHP part ?
01/28/2013 14:33 jcdace#10
Quote:
Originally Posted by Sedrika View Post
Why did not you just changed the PHP part ?
Because the time format changes on every persons computer...

I have on dude with 01/28/2013, I am 28/01/2013, one guy has 1/28/13

and if its different format it just doesn't work.


EDIT: Less of a "Hacky" Fix


Change the FileCheck() Function in CFunc.vb to:
Code:
    ' Datei überprüfen
    Public Shared Sub FileCheck(ByVal Param() As String)
        If File.Exists(Param(0)) Then
            If Not New FileInfo(Param(0)).LastWriteTime = DateTime.ParseExact(Param(2), "dd.MM.yyyy HH:mm:ss", CultureInfo.InvariantCulture) Or Not New FileInfo(Param(0)).Length = Param(1) Or (Config.UseMd5Check AndAlso Not Param(3) = CFunc.MD5FileHash(Param(0))) Then
                CFunc.DeleteFile(Param(0))
                CFunc.PatchList = CFunc.AddLineToStringArray(CFunc.PatchList, Param(0) & ".gz" & vbTab & Param(1) & vbTab & Param(2))
                CFunc.MaxUpdate += 1
            End If
        Else
            CFunc.PatchList = CFunc.AddLineToStringArray(CFunc.PatchList, Param(0) & ".gz" & vbTab & Param(1) & vbTab & Param(2))
            CFunc.MaxUpdate += 1
        End If
    End Sub
Will force the format to follow dd.MM.yyyy HH:mm:ss
01/28/2013 15:41 Sedrika#11
I'm gonna fix it in an another faster way.
My way only needs 2 lines.

Edit:

Ich habe jetzt schonmal zwei kleinere Änderungen durchgenommen.
- Es gab bei Usern mit dem MM.dd.yyyy Format einen Error, da diese nicht unser Datum format haben, dies wurde gefixxt.
- Man kann jetzt in den Konfigs die Farbe des Start Button auch bestimmen.

[Only registered and activated users can see links. Click Here To Register...]
01/28/2013 18:51 Crowley™#12
Sieht ganz nice aus. Finde den normalen Patcher aber iwi immer noch besser.
mfg. Crowley
01/28/2013 20:12 Sedrika#13
Jedermans geschmacksache :)
01/28/2013 20:15 jcdace#14
Quote:
Originally Posted by Sedrika View Post
I'm gonna fix it in an another faster way.
My way only needs 2 lines.

Edit:

Ich habe jetzt schonmal zwei kleinere Änderungen durchgenommen.
- Es gab bei Usern mit dem MM.dd.yyyy Format einen Error, da diese nicht unser Datum format haben, dies wurde gefixxt.
- Man kann jetzt in den Konfigs die Farbe des Start Button auch bestimmen.

[Only registered and activated users can see links. Click Here To Register...]

Uh ok? I wasn't being competitive, just trying to help =\
01/28/2013 20:17 Sedrika#15
Quote:
Originally Posted by jcdace View Post
Uh ok? I wasn't being competitive, just trying to help =\
I've never claimed. Thank you for the help, otherwise I wouldn't have noticed.