diasurgical / devilutionX

Diablo build for modern operating systems
Other
8.08k stars 795 forks source link

Write access to diabdat.mpq shouldn't be required #45

Closed vv221 closed 5 years ago

vv221 commented 5 years ago

Using the 0.3.0 build on 64-bit GNU/Linux (Debian Sid).

devilutionX will not launch if the current user has no write access to diabdat.mpq.

But it seems that this file is never modified, so is it really needed to request a write access to it?

AJenbo commented 5 years ago

Hi @vv221

You are correct in assuming this isn't needed. The reason that DevilutionX still requests it is that when Diablo was built, Storm did not have write capabilities. So there was no need to specify a mode, but the default for StormLib is R+W. It's not hard to fix, but at this stage, we would like to make as few changes to the engine as possible to avoid conflicts when merging clean ups from upstream.

Thanks for opening an issue so that we can clearly track the state of it.

kparal commented 5 years ago

I had a lot of troubles starting DevilutionX because the current error message as it's written sounds like the file must be read-only:

Your diabdat.mpq may not be in the Devilution folder and not read only.

Can you please rephrase it to make it clear? For example:

Your diabdat.mpq may not be in the Devilution folder or it's read only.

or somewhat improved:

Make sure "diabdat.mpq" is in the same folder as "devilutionx" binary and that you have write access to it (i.e. it's not marked read only).

Thanks!

AJenbo commented 5 years ago

@kparal thanks, I kept forgetting to correct that https://github.com/diasurgical/devilutionX/commit/30138419898a15d722f25f06d9d7dee279aac348

vv221 commented 5 years ago

It's not hard to fix, but at this stage, we would like to make as few changes to the engine as possible to avoid conflicts when merging clean ups from upstream.

No problem if this is not a priority right now, it’s nice enough to know you’re going to consider it at some point ;)

snigel commented 5 years ago

I didn't get an error message (maybe I missed it?), for me it looked like this:

pi@raspberrypi:~/Desktop/diablo $ ./devilutionx 
DUMMY: SetUnhandledExceptionFilter @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:507
DUMMY: GetSystemInfo @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:573
DUMMY: CreateFileMappingA @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:665
DUMMY: FindWindowA : class: DIABLO window: (null)
DUMMY: LoadIconA @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:431
DUMMY: LoadCursorA @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:446
DUMMY: LoadImageA @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:440
DUMMY: RegisterClassExA @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:399
DUMMY: UpdateWindow @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:382
DUMMY: UiAppActivate @ /home/pi/devilutionX/SourceX/DiabloUI/diabloui.cpp:422
DUMMY: GetWindowLongA @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:778
DUMMY: SetWindowLongA @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:784
DUMMY: SDrawRealizePalette @ /home/pi/devilutionX/SourceX/storm/storm.cpp:705
DUMMY: DefWindowProcA @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:769
DUMMY: SetCooperativeLevel @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:100
DUMMY: SetDisplayMode @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:106
DUMMY: CreateSurface @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:57
DUMMY: CreatePalette @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:42
DUMMY: SetPalette @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:203
DUMMY: GdiSetBatchLimit @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:270
DUMMY: GetCaps @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:159
DUMMY: CreateSurface @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:57
DUMMY: SDrawManualInitialize @ /home/pi/devilutionX/SourceX/storm/storm_dx.cpp:19
DUMMY: WaitForVerticalBlank @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:116
DUMMY: BltFast @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:136
DUMMY: Unlock @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:209
DUMMY: sound_DirectSoundCreate @ /home/pi/devilutionX/SourceX/sound.cpp:409
DUMMY: SVidInitialize @ /home/pi/devilutionX/SourceX/storm/storm.cpp:424
DUMMY: GetFileVersionInfoSizeA @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:167
DUMMY: GetFileVersionInfoA @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:175
DUMMY: VerQueryValueA @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:183
BasePath: /home/pi/Desktop/diablo/
DUMMY: SFileSetBasePath @ /home/pi/devilutionX/SourceX/storm/storm.cpp:699
SFileOpenFile: Not found: ui_art\title.pcx
DUMMY: SDrawDestroy @ /home/pi/devilutionX/SourceX/storm/storm.cpp:688
DUMMY: Release @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:130
DUMMY: Release @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:130
DUMMY: Release @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:240
DUMMY: Release @ /home/pi/devilutionX/SourceX/miniwin/ddraw.cpp:28
DUMMY: SNetDestroy @ /home/pi/devilutionX/SourceX/storm/storm_net.cpp:61
DUMMY: UiDestroy @ /home/pi/devilutionX/SourceX/DiabloUI/diabloui.cpp:128
DUMMY: SVidDestroy @ /home/pi/devilutionX/SourceX/storm/storm.cpp:430
DUMMY: SDrawDestroy @ /home/pi/devilutionX/SourceX/storm/storm.cpp:688
DUMMY: StormDestroy @ /home/pi/devilutionX/SourceX/storm/storm.cpp:693
DUMMY: UiDestroy @ /home/pi/devilutionX/SourceX/DiabloUI/diabloui.cpp:128
DUMMY: SVidDestroy @ /home/pi/devilutionX/SourceX/storm/storm.cpp:430
DUMMY: SDrawDestroy @ /home/pi/devilutionX/SourceX/storm/storm.cpp:688
DUMMY: StormDestroy @ /home/pi/devilutionX/SourceX/storm/storm.cpp:693
DUMMY: PostQuitMessage @ /home/pi/devilutionX/SourceX/miniwin/misc.cpp:763
DUMMY: PostMessageA @ /home/pi/devilutionX/SourceX/miniwin/misc_msg.cpp:294

You could see that the display changed, like just before it starts a full screen application, then it quit.

Adding permissions to diabdat.mpq made it launch okay. This is on a rpi 3b+ running raspbian buster

Before changing permissions it looked like this: -r-------- 1 pi pi 517501282 Jul 15 16:42 diabdat.mpq

AJenbo commented 5 years ago

@snigel this appears to be an issue with SDL on Raspbian not implementing dialogs, or possibly an optional dependency that has to be installed for this work.

darktjm commented 5 years ago

I use unionfs to work around broken games that need write access in the game directory, but I don't really like having duplicate copies of the mpq files. For now, I've just patched BaseFile_Open to retry read-write opens read-only (so it fails on first write, which never happens, rather than open).