team-phoenix / Phoenix

A multi-system emulator and library manager designed to be both powerful and easy to use.
http://phoenix.vg
GNU General Public License v2.0
376 stars 40 forks source link

Can't launch games that are zipped #190

Closed MisterTea closed 8 years ago

MisterTea commented 8 years ago

I dragged a folder with a zip into Phoenix, then tried to run the zip. Note that Phoenix found the artwork for the game so that seems to be correct, but the code that launches the game doesn't handle zip correctly at the moment:

Log:

Debugging starts
QML debugging is enabled. Only use this in a safe environment.
phoenix.library: Portable mode
phoenix.library: Opening library database /Users/jgauci/github/build-phoenix-Desktop_Qt_5_5_0_clang_64bit-Debug/frontend/Phoenix.app/Contents/MacOS/Metadata/systems.sqlite
phoenix.library: Opening library database /Users/jgauci/github/build-phoenix-Desktop_Qt_5_5_0_clang_64bit-Debug/frontend/Phoenix.app/Contents/MacOS/Metadata/openvgdb.sqlite
QML Debugger: Waiting for connection on port 58208...
phoenix.library: Opening library database /Users/jgauci/github/build-phoenix-Desktop_Qt_5_5_0_clang_64bit-Debug/frontend/Phoenix.app/Contents/MacOS/User Data/gamelibrary.sqlite
phoenix.input: Opening custom controller DB file: /Users/jgauci/github/build-phoenix-Desktop_Qt_5_5_0_clang_64bit-Debug/frontend/Phoenix.app/Contents/MacOS/User Data/gamecontrollerdb.txt
phoenix.input: Loaded custom controller DB successfully.
phoenix.library: mWorkerThread Started...
void Library::GameFileInfo::prepareMetadata() "1033EBA4"
phoenix.library: Worker Started...
ImportData:  "Super Nintendo" "zip:///Volumes/pawn/Roms/No-Intro/Nintendo - Super Nintendo Entertainment System/Mega Man X (USA).zip<><>Mega Man X (USA).sfc" "http://img.gamefaqs.net/box/7/2/8/19728_front.jpg"
qt.network.ssl: QSslSocket: cannot resolve SSL_set_psk_client_callback
qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_client_method
qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_client_method
qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_server_method
qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_server_method
qt.network.ssl: QSslSocket: cannot resolve SSL_select_next_proto
qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
qt.network.ssl: QSslSocket: cannot resolve SSL_get0_next_proto_negotiated
phoenix.library: Worker Finished...
phoenix.library: "/Volumes/pawn/Roms/No-Intro/Nintendo - Super Nintendo Entertainment System/Mega Man X (USA).sfc"  does not exist. Launch will fail...
athairus commented 8 years ago

Please try importing via the ( + ) button on the bottom left and see if that works.

MisterTea commented 8 years ago

I stepped through the debugger and found the issue: it can't write the extracted file because my roms folder isn't writable. Can we change that logic to write the extracted file to the /tmp directory?

MisterTea commented 8 years ago

Created a PR. Works on my system: let me know what you think.

athairus commented 8 years ago

You had said earlier that your extracted folder WAS writable...

MisterTea commented 8 years ago

I was wrong, sorry. I thought it was writable but I just verified that it isn't:

touch: /Volumes/pawn/test: Read-only file system
MisterTea commented 8 years ago

Hmm, it looks like the sram is based on the game location, so this PR will cause sram to go into a temp folder, which is not great :-/

athairus commented 8 years ago

Please try importing via the ( + ) button on the bottom left and see if that works.

MisterTea commented 8 years ago

Did you look at my PR? There's no way importing from the + button is going to fix the case where your rom zips are in a read-only folder.

athairus commented 8 years ago

Thanks for submitting the PR, but there's some more changes across the source that need to be done in order to make unzipping to a temp folder work. For starters, VideoItem needs additional properties that will hold the save, save state and system paths separate from the game path itself. I don't plan on working on VideoItem as we're already at work on a replacement system for the backend, #162.

As for the weirdness caused by importing a zip directly, we'll just have to disable dragging and dropping for the pre-alpha target if we can't find a quick fix.

JosephMillsAtWork commented 8 years ago

Why not chnge the permissions of the file with QFileDevice or omething like that. Like check the permissions and then change

On Tue, Oct 20, 2015 at 5:57 PM, athairus notifications@github.com wrote:

Thanks for submitting the PR, but there's some more changes across the source that need to be done in order to make unzipping to a temp folder work. For starters, VideoItem needs additional properties that will hold the save, save state and system paths separate from the game path itself. I don't plan on working on VideoItem as we're already at work on a replacement system for the backend, #162 https://github.com/team-phoenix/Phoenix/issues/162.

As for the weirdness caused by importing a zip directly, we'll just have to disable dragging and dropping for the pre-alpha target if we can't find a quick fix.

— Reply to this email directly or view it on GitHub https://github.com/team-phoenix/Phoenix/issues/190#issuecomment-149748205 .

athairus commented 8 years ago

Things are just incomplete at this stage.

Here's what's missing:

Also his volume was mounted read-only. That's not something we can change. I think it's safe to assume that from now on the folder that contains your games may not be writable. Best to keep everything that needs to be written under User Data/

It might also help to detect when Phoenix is launched from a read-only volume and either warn the user and not write anything or refuse to run.

athairus commented 8 years ago

This issue is blocked until these changes I've proposed are rolled into #207

athairus commented 8 years ago

Unzipping to a temp directory has been fixed as of https://github.com/team-phoenix/Phoenix/commit/91a4942f6fc29b34bbb09ab200f07cde7c061853.

Proper game scanning for .zip files is in progress in the corecontrol branch. Bug will be closed once this branch is merged into master.

athairus commented 8 years ago

Branch corecontrol has been merged, zip files now work perfectly along with drag & drop. Closed!

MisterTea commented 8 years ago

Thanks for your hard work!! On Mon, Nov 9, 2015 at 7:07 PM athairus notifications@github.com wrote:

Branch corecontrol has been merged, zip files now work perfectly along with drag & drop. Closed!

— Reply to this email directly or view it on GitHub https://github.com/team-phoenix/Phoenix/issues/190#issuecomment-155269543 .