stringlist_t list;
searchpath_t *search;
- if (iscache)
- strlcpy (fs_gamedir, dir, sizeof (fs_gamedir));
- else
- strlcpy (fs_gamecachedir, dir, sizeof (fs_gamedir));
-
stringlistinit(&list);
listdirectory(&list, "", dir);
stringlistsort(&list, false);
}
}
+ // test if we want to add the dir itself too
+ qboolean add_unpacked = true;
+ for (i = 0;i < list.numstrings;i++)
+ {
+ if (!strcasecmp(list.strings[i] + strlen(dir), ".packs-only"))
+ {
+ Con_Printf("Found %s/.packs-only file - not loading other files from there.", dir);
+ add_unpacked = false;
+ }
+ }
+
stringlistfreecontents(&list);
- // Add the directory to the search path
- // (unpacked files have the priority over packed files)
- search = (searchpath_t *)Mem_Alloc(fs_mempool, sizeof(searchpath_t));
- strlcpy (search->filename, dir, sizeof (search->filename));
- search->next = fs_searchpaths;
- fs_searchpaths = search;
+ if (add_unpacked)
+ {
+ // Add the directory to the search path
+ // (unpacked files have the priority over packed files)
+ search = (searchpath_t *)Mem_Alloc(fs_mempool, sizeof(searchpath_t));
+ strlcpy (search->filename, dir, sizeof (search->filename));
+ search->next = fs_searchpaths;
+ fs_searchpaths = search;
+
+ // Register the directory as a writable path.
+ if (iscache)
+ strlcpy (fs_gamedir, dir, sizeof (fs_gamedir));
+ else
+ strlcpy (fs_gamecachedir, dir, sizeof (fs_gamedir));
+ }
}
#include <sys/mount.h>
static void NaCl_Init(void)
{
+ char vabuf[1024];
+
mount("", "/dev", "dev", 0, "");
mount("", "/.config", "html5fs", 0, "type=PERSISTENT,expected_size=8388608");
mount("", "/.cache", "html5fs", 0, "type=TEMPORARY,expected_size=1073741824");
- mount("", "/http", "httpfs", 0, "cache_stat=true,cache_content=false");
- int fd = open("/dev/console0", O_WRONLY, 0644);
- outfd = fd;
+
+ const char *http_root = "";
+ int i = COM_CheckParm("-http_root");
+ if (i && i < com_argc - 1)
+ http_root = com_argv[i + 1];
+ int cache_content = COM_CheckParm("-http_cache_content");
+
+ mount(http_root, "/http", "httpfs", 0, va(vabuf, sizeof(vabuf),
+ "cache_stat=true,cache_content=%s,allow_cross_origin_requests=true",
+ cache_content ? "true" : "false"));
}
#endif