Ravo92 / aio-lotr-launcher

BFME Launcher for BFME, BFME 2, ROTWK. Also known as 2.22 Launcher for Battle for Middle Earth 1
MIT License
38 stars 7 forks source link

Downloader doesn't work properly #33

Open s-iso opened 11 months ago

s-iso commented 11 months ago

https://github.com/Ravo92/Patch-2.22-Launcher/blob/b84c94ffff563cbfaa73fdbd19e19c0b1c305bba/Helper/GameFileTools.cs#L102

Can't really find any documentation on this "DownloadService", but through debugging I've noticed that on unstable internet connections, this utility will download a faulty file.

I've doublechecked the download from your Cloudflare R2 bucket and it seems to work flawlessly (as expected from Cloudflare), so it's not an error from that side.

One of my theories is that the Timeout of 5000ms is a bit too tight. One would expect that the download would fail outright when the Timeout is reached (which would be the case on unstable internet connections), but this doesn't seem to be the case, as there seems to be no error message anywhere and the download just continues.

I'd love to fix the issue myself but again, I haven't found any documentation on your "Downloader" util. If you could either show me Documentation (or even better, the sourcecode itself) I'd love to get at it.

Ravo92 commented 11 months ago

Im totally aware that this is not a complete feature at all.

Its just the most basic "you are now able to download stuff".

With the new gui branch i want to make it way more stable and also implement a autosave and resume feature like steam has.

The library i used for this downloader is this repository:

https://github.com/bezzad/Downloader

DilepDev commented 6 months ago

not sure if this is related, I'm experiencing issues when downloading the game

BFME1Launcher.log

2024-05-11 19:46:34.805 +05:30 [ERR] MD5 HashSum check failed. Should be: 97258F514DCE6EB4D5D110DBB4D3CCA3 was: 654C02C40D6D1C21BF80EBA48C6C490E
2024-05-11 19:46:34.805 +05:30 [INF] Deleting file > BFME1.7z < and retry Download...
2024-05-11 19:46:35.082 +05:30 [INF] Now trying to extract > BFME1.7z <
2024-05-11 19:46:35.125 +05:30 [ERR] SevenZipExtractor.SevenZipException: Archive file not found
   at SevenZipExtractor.ArchiveFile..ctor(String archiveFilePath, String libraryFilePath)
   at Helper.GameFileTools.<>c__DisplayClass9_0.<ExtractFile>b__0() in C:\GIT\Patch-2.22-Launcher\Helper\GameFileTools.cs:line 154
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at PatchLauncher.WinFormsMainGUI.InstallUpdateRepairRoutine(String ZIPFileName, List`1 DownloadURLs, String CorrectMD5HashValue) in C:\GIT\Patch-2.22-Launcher\BFME1\WinFormsMainGUI.cs:line 808
2024-05-11 21:09:07.941 +05:30 [ERR] MD5 HashSum check failed. Should be: 97258F514DCE6EB4D5D110DBB4D3CCA3 was: 404
2024-05-11 21:09:07.941 +05:30 [INF] Deleting file > BFME1.7z < and retry Download...
2024-05-11 21:09:07.941 +05:30 [INF] Now trying to extract > BFME1.7z <
2024-05-11 21:09:07.942 +05:30 [ERR] SevenZipExtractor.SevenZipException: Archive file not found
   at SevenZipExtractor.ArchiveFile..ctor(String archiveFilePath, String libraryFilePath)
   at Helper.GameFileTools.<>c__DisplayClass9_0.<ExtractFile>b__0() in C:\GIT\Patch-2.22-Launcher\Helper\GameFileTools.cs:line 154
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at PatchLauncher.WinFormsMainGUI.InstallUpdateRepairRoutine(String ZIPFileName, List`1 DownloadURLs, String CorrectMD5HashValue) in C:\GIT\Patch-2.22-Launcher\BFME1\WinFormsMainGUI.cs:line 808
Ravo92 commented 6 months ago

Thank you. This error will be gone with the new GUI. stay tuned!