atidot3 / GameLauncher

34 stars 25 forks source link

Problem with some Files #1

Closed andelwol26 closed 6 years ago

andelwol26 commented 6 years ago

Heii,

i am using your code for a game Updater for a 15 GB Game. This works perfektly, but unfortunately not for all files. Some Files work perfektly and some files make following error. Do you have a idea? neue bitmap

atidot3 commented 6 years ago

Hello,

The launcher is not completly done, unexpected thing can happen, try run it with visual studio and get a stack trace and try to debug it. Also what are the file wich make the launcher crash ? big data ? Can you provide more information to make me able to help you :).

andelwol26 commented 6 years ago

I looked for the reason why my Updater breaks up. And i see that the Updater starts to verify the Game bevore the last File is finished to download. The file is in use while the verify is try to read it. I tryed a long time to fix this but i am new with C#.

Do you have any idea why the verify starts that early and how could i fix this?

This is the screen marked screen when the programm stops.

grafik

atidot3 commented 6 years ago

The idea is to check if getIsDownloading() is true or not at backgroundWorker1_RunWorkerCompleted and wait it to be true. This should fix your issue, also what is the file size ?

andelwol26 commented 6 years ago

Thank you a thousand times! I check it and hope i am smart enough to make it work. The file size is 1,7 GB. But i think that file size is not problem. Other files with this size are downloaded without a problem. Only when a big file is the last one. The verification starts exactly when the last file starts to download. If i could do this i will let you know.

andelwol26 commented 6 years ago

Do you mean like this? I also tested it with Messageboxes and the getIsDownloading() is not getting true. Sorry when i make a stupid fail.

grafik

atidot3 commented 6 years ago

i'm confuse, i test it with 16gb and i didn't get any error.

andelwol26 commented 6 years ago

And when you try just one File with about 1,5 GB?

H0neyCake commented 6 years ago

Sorry, I do not know if it's worth creating a new task for this. Perhaps the problem is similar. At me at downloading of the last file, launcher to be crashed. I used only 5 files for the test. The total size is ~ 100 mb.

H0neyCake commented 6 years ago

And i guess launcher can't delete files, if file dont announced in manifest.dat?

H0neyCake commented 6 years ago

Maybe, if it's not difficult for you, you will update the repository. Thanks.

atidot3 commented 6 years ago

Are you trying localhost or remotly ? For sure you can update the repository :).

Also manifest only add or remove existing file, unexisting file on manifest will not be deleted, as explained, this is a very first version.

I'll try to investigate more this WE, i don't have that much time with my work during week ! 👍

H0neyCake commented 6 years ago

Yes, i check ftp data. All is download, but last file have problem, and VS drop exeption like this: https://i.gyazo.com/19e32b49712cd757ee53f20cecd5ca70.png

It says System.IO.IOException: "The process can not access the file" C: \ Users \ Dmitry \ Desktop \ GameLauncher \ Launcher \ bin \ Debug \ @TestMod \ addons \ zorak_porsche_cayenne.pbo ", because this file is used by another process. "

But this file cant used by another process. Anyway, thanks for help, if i found something i make pull request, if you do not mind :)

H0neyCake commented 6 years ago

Yes, there is definitely some problem with the last file in the download. I fixed a problem with a simple scan. But Now, just on the last file, the download stopped showing in the progress bar, although the file itself is loaded. And after restarting the program, all the vails are successfully tested.

andelwol26 commented 6 years ago

@H0neyCake could you send your files? This would be nice!

H0neyCake commented 6 years ago

@andelwol26 I did not change anything, except for this check. code

Launcher download last file, but progress bar does'n change value.

andelwol26 commented 6 years ago

same here but it is not working... i also redownloaded the Original files and reuploaded my html files... don't know what is the Problem... grafik

atidot3 commented 6 years ago

What about add some debug ? How many file the manifest generator found, how many the launcher try to download, maybe the manifest generator is in cause i made it like in 20 minutes quickly

Also what about: private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { // no GUI method ! for (int i = 0; i <= downloadList.Count;)

Change to <= to be sure the last file is downloaded

H0neyCake commented 6 years ago

I told you, manifest generator works greate. And with this check all files done, but in last file progress bar just freezes. Unfortunately, this is not my project, and I can not quickly debug it. Since I study it only a couple of hours. If everything works well on your computer, maybe you will update the entire git repository. Maybe you made a little bugfix and just forgot about it. Thanks.

H0neyCake commented 6 years ago

@atidot3 i try to do this, but its wrong. System.ArgumentOutOfRangeException: "Index outside the range." The index must be a positive number, and its size must not exceed the size of the collection. Parameter name: index "

atidot3 commented 6 years ago

Can you try with the generator here to be sure http://sharkman.asuscomm.com/files/public/Launchpad/Utilities/LaunchpadUtilities.zip

Im looking around but i've only m'y phone atm

atidot3 commented 6 years ago

An other idea is to check on: client_DownloadFileCompleted If the last file is completed and only then call updatecompleted

H0neyCake commented 6 years ago

First idea didn't work.

Can u write this condition? Bc i'm not sure i can do this.

Means like this? if(currentFile == downloadList.Count) { downloadInProgress = false; }

atidot3 commented 6 years ago

If currentfile = lastfile => Updatecompleted

And remove this part (if isdownloading etc updatecompleted) from workercomplet too to avoid some unexpected thing.

H0neyCake commented 6 years ago

Nah, its doesnt work.

atidot3 commented 6 years ago

Well i dont have any other idea for now, ill try to see tomorrow if i have some free time. But a Friend as used it and he didnt hot any issue too si its really strange.

H0neyCake commented 6 years ago

Any news?

atidot3 commented 6 years ago

Is it possible to provide me your manifest / config to reproduce the issue, i'm not able to make it crash with my file.

andelwol26 commented 6 years ago

This is my Manifest.dat You could try it also with my config. Manifest.zip

atidot3 commented 6 years ago

I can't do anything with this, there is no config etc.

andelwol26 commented 6 years ago

I don't know which config you exactly mean. I uploaded the complete Launcher for you. I hope you can take what you need from there.

GameLauncher-master_fail.zip

andelwol26 commented 6 years ago

I again spent a few hours to test. I tested the following situations: 4 100 MB Files local webserver download = no Problem 3 100 MB Files and as last one one 411 MB File local webserver download = get the error again.

I only configured the Resources.resx with the Path to my Webserver. So i don't know what config File you mean.

My idea why you get no error: Could it be that your Internet Connection is such fast (or your computer is so slow) that you downloaded the last File so fast that the download is finished before your verification starts?

That are the only reasons i could think of that you are getting no error.

I have to admit I'm still too bad to find the mistake. If someone could find the mistake and fix it, it would be worth a bit of money to me. I'm already desperate.

atidot3 commented 6 years ago

The launcher is not working with only 1 file, and when i make it working the progress bar never changed until the file is downloaded.

andelwol26 commented 6 years ago

The download of the one file was only the test for the error of the last file. I have a lot more files, but one file will most be modified. But do you mean you could fix it, but the progress bar is standing by the last file? That would be thinkable for me too. Would be better for me as that the error on the last file.

atidot3 commented 6 years ago

It's in progress, 1 file is working perfect with progress bar / download size etc, i need to test with huge now.

atidot3 commented 6 years ago

I let you try, if it still won't work i have no idea.

andelwol26 commented 6 years ago

The first look is perfect. i make a full test later. I let you know if it works.

H0neyCake commented 6 years ago

I already make some test. Work great.

andelwol26 commented 6 years ago

yes no problems anymore. @atidot3 do you have a paypal mail? So i could send you a smal thank.