arunkumarmunusamy / bitfighter

Automatically exported from code.google.com/p/bitfighter
Other
0 stars 0 forks source link

Rerun copyResourcesToUserData() if resources are missing #445

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I stumble upon an issue while packaging bitfighter 019c for Mageia: for some 
reason I ended up in a state where I had a ~/.bitfighter directory which lacked 
music/ and scripts/ subfolders (and probably others too, but the game only 
complained about those).

I'm not 100% sure about why my ~/.bitfighter directory lacked the resources. 
Still, I had a look at the code and it seems the copyResourcesToUserData() 
routine (or a subset of it) could be called again if some resources are missing 
from ~/.bitfighter. What do you think?

Moreover, is it really necessary to copy all resources to ~/.bitfighter? I 
guess it makes sense for resources that need to be editable, but is there a 
reason to copy e.g. all music files to ~/.bitfighter? That's 10M duplicate data 
since the music is also installed in the LINUX_DATA_DIR.

Original issue reported on code.google.com by rverschelde on 28 Jun 2014 at 7:27

GoogleCodeExporter commented 9 years ago
Just to provide some more context, copyResourcesToUserData() is currently 
called by the prepareFirstLaunch() routine. The latter is called upon starting 
only if ~/.bitfighter does not exist, so the resources are not copied if the 
directory exists but lacks them.

Original comment by rverschelde on 28 Jun 2014 at 7:31

GoogleCodeExporter commented 9 years ago
It could be our first-launch logic is bad somehow - 

Did you happen to have a ~/.bitfighter directory without the game resources 
beforehand?

Another check we do is the version check in the INI.  If it is a different 
version, we also do a resource update.

I also opened issue 446 to address pulling from multiple resource directories.

Original comment by buckyballreaction on 28 Jun 2014 at 2:36

GoogleCodeExporter commented 9 years ago
Yes I'm not sure why I ended up with a ~/.bitfighter directory without the game 
resources. Before I made my package I tried building and playing the game 
without generating an RPM, so maybe for some reason my locally built version 
was a "standalone" version? (IIRC there is a "if(!standalone)" in the main 
routine that starts the prepareFirstLaunch() routine).

I tried to reproduce, deleting the ~/.bitfighter directory and doing several 
types of build, but everything worked out well in the end.. So this issue would 
more cater to users who tried to play around with the files in ~/.bitfighter 
and broke their setup :-)

Original comment by rverschelde on 28 Jun 2014 at 3:15

GoogleCodeExporter commented 9 years ago
OK.  Maybe a more thorough integrity check of the entire preference directory 
instead of just an existence check of the top folder.  Then iff the check 
fails, do a full resource copy again.  

Although, maybe issue 446 would obsolete this.

Original comment by buckyballreaction on 28 Jun 2014 at 8:39