On iOS the user only has access to the Documents directory via iTunes. Our folder structure is setup as such to read from the Res directory. This change allows users to drop in zip files into the Documents folder and the game will automatically move the zip file into the Res folder on app startup. Note, this is only done on app startup. If the game is running in the background, the user will need to quit the app ( kill it via the multithreaded task bar) and restart it.
Jailbroken devices have full access to the filesystem and don't have this restriction. although I do recommend that they do drop zip files into the Documents directory to reduce the risk of causing any undefined behavior with updating the config files while the game runs.
This commit is contained in:
@@ -106,8 +106,7 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
|
||||
string userPath = _userPath;
|
||||
|
||||
#ifdef IOS
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory,
|
||||
NSUserDomainMask, YES);
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString *documentsDirectory = [[paths objectAtIndex:0] stringByAppendingString: @"/Res"];
|
||||
|
||||
userPath = [documentsDirectory cStringUsingEncoding:1];
|
||||
|
||||
Reference in New Issue
Block a user