Closed 616dustin closed 1 year ago
@bubio do you have an idea what could be the issue here?
@616dustin Try to make the file name diabdat.mpq or spawn.mpq all uppercase! (DIABDAT.MPQ)
@616dustin Try to make the file name diabdat.mpq or spawn.mpq all uppercase! (DIABDAT.MPQ)
How would that help if there is no DevilutionX folder?
@616dustin
I tried with the master repository, but there is no folder. Try Method 2 or Method 3 in the following document.
https://github.com/diasurgical/devilutionX/blob/master/docs/installing.md
@AJenbo
If the Document folder in the app bundle is empty, files.app doesn't seem to see the folder. At present, Method 1 cannot be used. It may be good if the generation timing of diablo.ini can be advanced.
@bubio Method 2 worked for me. Oddly when i first launched it i received a warning that not all hellfire mpq's were found, even though i have the 4 hellfire mpqs. upon restarting the app everything seems to work great, thank you!
@AJenbo
If the Document folder is empty, I guess one solution would be to create an empty hidden file.
char *IOSGetPrefPath()
{
@autoreleasepool {
NSArray *array = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
if ([array count] > 0) {
NSString *str = [array objectAtIndex:0];
// Countermeasure for the problem that folders are not displayed in iOS file.app when the Document folder is empty.
// Create an empty hidden file.
NSFileManager *fm = [NSFileManager defaultManager];
NSArray *files = [fm contentsOfDirectoryAtPath:str error:nil];
if ([files count] == 0) {
NSString *keepFile = [str stringByAppendingPathComponent:@".reveal"];
[fm createFileAtPath:keepFile contents:nil attributes:nil];
}
str = [str stringByAppendingString:@"/"];
const char *base = [str fileSystemRepresentation];
char *copy = malloc(strlen(base) + 1);
strcpy(copy, base);
return copy;
}
return "";
}
}
we do that on startup and then delete it
can you test the latest build?
@AJenbo
I built the latest source code and tried it, but the folder did not show up in files.app.
It's odd because SaveOptions()
is called just before showing the intro and menu:
https://github.com/diasurgical/devilutionX/blob/master/Source/diablo.cpp#L2424
Maybe we need to change it so that it will will see the ini file as changed if there isn't an ini file yet: https://github.com/diasurgical/devilutionX/blob/928d00e9a8dc2f3f0276145cb00cec296ffdbbe9/Source/options.cpp#L237
After displaying an error dialog, the program terminates immediately.
Although aggressive, the following will create an ini file and display the Document folder.
void diablo_quit(int exitStatus)
{
SaveOptions(); // <- Add this line
FreeGameMem();
music_stop();
DiabloDeinit();
exit(exitStatus);
}
It's odd because
SaveOptions()
is called just before showing the intro and menu: https://github.com/diasurgical/devilutionX/blob/master/Source/diablo.cpp#L2424
It's because the game crashes on the call to LoadGameArchives()
a few lines above that.
we do that on startup and then delete it
I think you're talking about the call to ReadOnlyTest()
in DiabloInit()
, which is also called just a bit too late. The game just doesn't bother trying to create any files if it can't find the game data in LoadGameArchives()
.
We could pull ReadOnlyTest()
out of DiabloInit()
and call it directly in DiabloMain()
. That would allow us to create the temp file before loading the game archives. However, I think the reason we call them in that order is because we can't display the proper error dialog until the main window has been created.
If the Document folder is empty, it will not appear in files.app, so some file must be created in the Document folder. ReadOnlyTest() will delete the file it created, right?
Yes, it will. So what you're saying is, we can't resolve this issue using ReadOnlyTest()
because the folder will be empty again after the temp file is deleted, right?
Yes, it will. So what you're saying is, we can't resolve this issue using
ReadOnlyTest()
because the folder will be empty again after the temp file is deleted, right?
That’s correct.
Operating System
iOS
DevilutionX version
1.4.1 (latest release)
Describe
Sideloaded via Altstore, launched DevilutionX, received a "Data File Error" warning. "Unable to open main data archive (diabdat.mpq or spawn.mpq
Make sure it is in the game folder"
i click OK and close the app then open files.app and go to "On My iPhone" and there is no DevilutionX folder.
I tried creating the folder and adding the mpq's but i receive the same error.
To Reproduce
Expected Behavior
there should be a devilutionx folder to upload the mpq's to.
Additional context
iPhone 14 Pro Max iOS Version: 16.0.3