return cache_dir;
}
+static char *getNetworkDir()
+{
+ static char *network_dir = NULL;
+
+ if (network_dir == NULL)
+ network_dir = getPath2(getUserGameDataDir(), NETWORK_DIRECTORY);
+
+ return network_dir;
+}
+
static char *getLevelDirFromTreeInfo(TreeInfo *node)
{
static char *level_dir = NULL;
return userlevel_dir;
}
+char *getNetworkLevelDir(char *level_subdir)
+{
+ static char *network_level_dir = NULL;
+ char *data_dir = getNetworkDir();
+ char *networklevel_subdir = LEVELS_DIRECTORY;
+
+ checked_free(network_level_dir);
+
+ if (level_subdir != NULL)
+ network_level_dir = getPath3(data_dir, networklevel_subdir, level_subdir);
+ else
+ network_level_dir = getPath2(data_dir, networklevel_subdir);
+
+ return network_level_dir;
+}
+
char *getCurrentLevelDir()
{
return getLevelDirFromTreeInfo(leveldir_current);
}
}
+void InitNetworkLevelDirectory(char *level_subdir)
+{
+ if (!directoryExists(getNetworkLevelDir(level_subdir)))
+ {
+ createDirectory(getUserGameDataDir(), "user data", PERMS_PRIVATE);
+ createDirectory(getNetworkDir(), "network data", PERMS_PRIVATE);
+ createDirectory(getNetworkLevelDir(NULL), "main network level", PERMS_PRIVATE);
+ createDirectory(getNetworkLevelDir(level_subdir), "network level", PERMS_PRIVATE);
+ }
+}
+
void InitLevelSetupDirectory(char *level_subdir)
{
createDirectory(getUserGameDataDir(), "user data", PERMS_PRIVATE);
void InitTapeDirectory(char *);
void InitScoreDirectory(char *);
void InitUserLevelDirectory(char *);
+void InitNetworkLevelDirectory(char *);
void InitLevelSetupDirectory(char *);
TreeInfo *newTreeInfo();
char *getUserGameDataDir(void);
char *getSetupDir(void);
char *getUserLevelDir(char *);
+char *getNetworkLevelDir(char *);
char *getCurrentLevelDir(void);
char *getNewUserLevelSubdir(void);
#define DOCS_DIRECTORY "docs"
#define CACHE_DIRECTORY "cache"
#define CONF_DIRECTORY "conf"
+#define NETWORK_DIRECTORY "network"
#define GFX_CLASSIC_SUBDIR "gfx_classic"
#define SND_CLASSIC_SUBDIR "snd_classic"