Hallo,
habe nur ein kleines Problem denke ich mal und stehe ziemlich auf dem schlauch.
Der Patcher an sich läuft soweit, nur ist das Problem das er egal ob das File vorhanden ist, es immer und immer wieder neu downloadet wenn ich den Patcher starte.
Ich hoffe Ihr könnt mir weiter helfen, nach 1 1/2 Tagen suchen und lesen habe ich es nicht hinbekommen das er vorher schaut ob die Files vorhanden sind und wenn vorhanden dann Skip ansonsten downloaden.
Hier der code..
Bitte um Hilfe, BITTE!
habe nur ein kleines Problem denke ich mal und stehe ziemlich auf dem schlauch.
Der Patcher an sich läuft soweit, nur ist das Problem das er egal ob das File vorhanden ist, es immer und immer wieder neu downloadet wenn ich den Patcher starte.
Ich hoffe Ihr könnt mir weiter helfen, nach 1 1/2 Tagen suchen und lesen habe ich es nicht hinbekommen das er vorher schaut ob die Files vorhanden sind und wenn vorhanden dann Skip ansonsten downloaden.
Hier der code..
PHP Code:
ProgressOn("Updater", "Patch wird gedownloadet", "Downloade Patchlist.ini ...")
$patch = IniRead(@ScriptDir & '\patch.ini',"host","url","default")
$hDownload = InetGet($patch, @ScriptDir & '\Patchlist.ini', 1)
InetClose($hDownload)
sleep(1000)
$iAnzahl = Number(IniRead(@ScriptDir & '\patchlist.ini', 'Files', 'Anzahl', -1))
If $iAnzahl > 0 Then
$iGesamtGroesse = 0
For $iIndex = 1 To $iAnzahl
$sFile = IniRead(@ScriptDir & '\patchlist.ini', 'Files', 'File' & $iIndex, "")
If $sFile = "" Then
MsgBox(266256, "Fatal Error", "Ein fataler Fehler ist aufgetreten:" & @CRLF & "Beschädigte Patchlist.ini")
Else
ProgressSet(0, "Ermittle Daten (1/"&$iAnzahl&")")
$iGesamtGroesse += InetGetSize($sFile, 1)
EndIf
Next
$iBereitsGedownloadet = 0
ProgressSet(0, "Downloade Patch-Files (1/"&$iAnzahl&")")
For $iIndex = 1 To $iAnzahl
$sFile = IniRead(@ScriptDir & '\patchlist.ini', 'Files', 'File' & $iIndex, "")
If $sFile = "" Then
MsgBox(266256, "Fatal Error", "Ein fataler Fehler ist aufgetreten:" & @CRLF & "Beschädigte Patchlist.ini")
Else
If Not FileExists(@ScriptDir & '\mods\' & FileGetName($sFile)) Then FileDelete(@ScriptDir & '\mods\' & FileGetName($sFile))
$hDownload = InetGet($sFile, @ScriptDir & '\mods\' & FileGetName($sFile), 1, 1)
Do
$iAktuellGedownloadet = $iBereitsGedownloadet + InetGetInfo($hDownload, 0)
ProgressSet(Ceiling($iAktuellGedownloadet / $iGesamtGroesse * 100), "Downloade Patch-Files ("&$iIndex&"/"&$iAnzahl&")")
Sleep(25)
Until InetGetInfo($hDownload, 2)
InetClose($hDownload)
EndIf
$iBereitsGedownloadet += FileGetSize(@ScriptDir & '\mods\' & FileGetName($sFile))
ProgressSet(Ceiling($iBereitsGedownloadet / $iGesamtGroesse * 100), "Downloade Patch-Files ("&$iIndex&"/"&$iAnzahl&")")
Next
ElseIf $iAnzahl = -1 Then
MsgBox(266256, "Fatal Error", "Ein fataler Fehler ist aufgetreten:" & @CRLF & "Beschädigte Patchlist.ini")
EndIf
ProgressSet(100, "Download komplett")
Sleep(1000)
ProgressOff()
Func FileGetName($sPath)
Local $aStrings
$aStrings = StringSplit($sPath, '/')
Return $aStrings[$aStrings[0]]
EndFunc