Jump to content


Photo

15/07/06 build


  • Please log in to reply
7 replies to this topic

#1 igi

igi

    IESDP Guardian

  • Gibberlings
  • 1210 posts
  • Gender:Male

Posted 15 July 2006 - 02:57 AM

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.

#2 Orions_Stardom

Orions_Stardom
  • Gibberlings
  • 206 posts

Posted 15 July 2006 - 03:36 AM

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 .

#3 Orions_Stardom

Orions_Stardom
  • Gibberlings
  • 206 posts

Posted 15 July 2006 - 04:10 AM

Ok, I just uploaded a new build (sticky is updated with new URL), this one has a progress bar.

#4 igi

igi

    IESDP Guardian

  • Gibberlings
  • 1210 posts
  • Gender:Male

Posted 15 July 2006 - 08:57 AM

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);
  }

Edited by igi, 15 July 2006 - 08:59 AM.


#5 Orions_Stardom

Orions_Stardom
  • Gibberlings
  • 206 posts

Posted 15 July 2006 - 04:50 PM

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.

Edited by Orions_Stardom, 15 July 2006 - 05:30 PM.


#6 igi

igi

    IESDP Guardian

  • Gibberlings
  • 1210 posts
  • Gender:Male

Posted 16 July 2006 - 12:51 AM

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.

#7 Orions_Stardom

Orions_Stardom
  • Gibberlings
  • 206 posts

Posted 20 July 2006 - 07:41 PM

Ok, I went ahead and put a proper progress bar in 5.0 Beta 1. It still doesn't quite work as expected, but I'm hoping to have that by 5.0 proper.

#8 Orions_Stardom

Orions_Stardom
  • Gibberlings
  • 206 posts

Posted 07 December 2006 - 03:29 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users