#9 Games inside packed archives launched with duplicated path

closed-fixed
java (5)
3
2009-12-08
2009-12-05
No

There's a bug in the latest version of JGameBase (0.45 patchset 2): when you try to run a game that's inside of a compressed archive (like 7z), JGameBase launches the shell script of the emulator with the temp directory path duplicated, as in "emulator.sh /tmp/jgamebase/tmp/jgamebase/filename.ext".

I've tracked the problem via debugging with Eclipse, and I've found its cause. The problem is that in function play() from Game.java (it starts at line 1000), when isAlreadyExtracted is false and then game.getFileToRun().equals("") is false, line 1036 is executed and that is the one that is wrong, in my opinion. That line is currently:

fileToRun = new File(TempDir.get(), game.getFileToRun()).toString();

When it should be instead:

fileToRun = game.getFileToRun();

Because after that, at line 1061, when the script is about to be launched, the temp directory path is unconditionally added:

command = script.toString() + " " + new File(TempDir.get(), fileToRun).toString();

So if the previous line is as it currently is, the temp directory path is added twice.

Discussion

  • José Manuel Ferrer Ortiz

    • assigned_to: nobody --> fgerbig
     
  • José Manuel Ferrer Ortiz

    I don't know why this report wasn't automatically assigned to fgerbig, but I guess that's the right way to notify him of it, so I'll assign it to him now.

     
  • F. Gerbig

    F. Gerbig - 2009-12-08

    Hi José,

    you were right, the mentioned line was the cause for the error.
    I just released patch #3 for jGameBase 0.45.
    Please try it and come back to me.

    Kind regards,
    Frank.

     
  • F. Gerbig

    F. Gerbig - 2009-12-08
    • priority: 5 --> 3
    • status: open --> pending
     
  • José Manuel Ferrer Ortiz

    It is working now, thank you very much :)

     
  • F. Gerbig

    F. Gerbig - 2009-12-08
    • status: pending --> closed-fixed
     


Anonymous

Cancel  Add attachments