Jump to content

15/07/06 build


igi

Recommended Posts

The latest build (from the 15th) doesn't copy folders for me.

It looks like the folder and files in it, are being copied to a single file (i.e. here's a missing / on the end of the command), as I have a *file* called 'override', and a *file* called 'script compiler' etc.

 

Also, a few suggestions:

1) Add version numbers (yes, even for the beta builds) :)

2) Some sort of progress indication would be nice

3) Options to select which files/folders to copy would also be nice.

Link to comment

Damn. I was hoping that bug was a quirk on andrew's system. ;) I'm looking into it, but I'm not sure what causes it - the full amount of testing I've been able to do myself (while I'm in the process of setting up a Win98 machine for testing properly) has determined that it isn't the method FileSystem.copy(), and yet that's the only thing that knows about directories vs. files.

 

For your suggestions -

1) I plan to do once these are actually betas (at the moment, especially with that dataloss stuff the other day, I'm considering them pre-alpha). Essentially, I'll be numbering versions that are pushed to the General Public, and datestamping versions that are for Brave Testers.

2) Will work on this. I don't imagine it will take very long. I don't think I'll be able to do it *properly* without a reasonable-size architecture change (which I'll look at after 5.0), but it shouldn't be overly hard to atleast do better than what we've got at the moment.

3) This will take a fair bit more, since it only realy makes sense on Windows (the Mac version shadows the whole dir with symlinks, copies files that need to not be transient across installs, and modifies the ini). But yes, it *is* desirable - probably won't have it for 5.0 (need to set some limits or it'll never ship :)), but I'll definately look into it after that .

Link to comment

The new build still doesn't copy directories.

And I cannot see a progressbar.

 

 

The following hacked up code fixes the folder copying, for me at least.

No idea what effect it would have on a Mac though.

 

   /**
  * Makes a folder and any required parent folders.
  */
  public static void makeFolder(String s) {
    boolean success;

    success = (new File(s)).mkdirs();
    if (!success) {
      System.out.println("Could not make folder " + s);
    }

  /**
  * Copies the game into sink.
  */
 public final void cloneTo(File sink) throws IOException, 
         FileSystem.PatchFailedException{
   doPreProcessing(sink);

   for(String filename : getFiles()){
     File sourceFile = new File(this, filename);
     System.out.println("sink = " + sink);

     if (sourceFile.isDirectory())
     {
       makeFolder(sink + "\\" + filename);
       File sinkSub = new File(this, filename);
       System.out.println("sinksub = " + filename);

       String[] children = sourceFile.list();
       for (int i=0; i<children.length; i++)
       {
         System.out.println("child[i] = " + children[i]);
         File sourceFileB = new File(this, filename + "\\" + children[i]);
         System.out.println("sourceFileB " + sourceFileB);
         System.out.println("sink = " + sink);
         System.out.println("sinksub = " + filename);
         System.out.println("children[i] = " + children[i]);
         File sourceFileC = new File(sink + "\\" + filename + "\\" + children[i]);
         System.out.println("sourceFileC " + sourceFileC);
         FileSystem.copy(sourceFileB, sourceFileC, getPatchFor(filename));
       }
     }
     else if (sourceFile.exists() || require(filename)){
       FileSystem.copy(
         sourceFile, 
         sink,
         getPatchFor(filename)
       );
     }
   }
   doPostProcessing(sink);
 }

Link to comment

I'm reluctant to make those kind of changes to GameDir (in the interests of keeping separate functionality separated) but I have made some changes along those lines to FileSystem.copy(). If source is a directory, it now properly bails out if sink is not a directory, and creates sink as a directory if it doesn't exist. It should, hopefully, have precisely the same effect as your code - namely, that this should actually work now.

Link to comment
I'm reluctant to make those kind of changes to GameDir (in the interests of keeping separate functionality separated)

 

Sure, I only hacked it up as it was kind of frustrating it not working, and I wanted to see it work :)

 

this should actually work now.

 

Yep, copying appears to work fine, nice ;)

I still cannot se the progressbar though.

Link to comment

Ok, version numbers are done (we shipped 5.0 a while ago); progress indication has existed for a while - and shows up - but is buggy (it shows up at the end of the build, stays empty during it), and another thread dealing with optional copying has just now been moved to pending. I'm going to say that the current progress indication is Good Enough for this thread to be moved to fixed (since it's done in 5.0), and open a new thread specifically for odd GUI issues.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...