[Download]: Fix listing of files
This commit is contained in:
parent
1bf8601998
commit
5331f23495
@ -466,16 +466,12 @@ namespace Components
|
||||
std::vector<nlohmann::json> fileList;
|
||||
|
||||
const auto path = (*Game::fs_basepath)->current.string / fsGame;
|
||||
auto list = Utils::IO::ListFiles(path, false);
|
||||
auto list = FileSystem::GetSysFileList(path.generic_string(), "iwd", false);
|
||||
list.emplace_back("mod.ff");
|
||||
|
||||
for (const auto& file : list)
|
||||
{
|
||||
auto filename = path / file;
|
||||
if (filename.extension() != ".iwd"s) // We don't want to serve other files
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (file.find("_svr_") != std::string::npos) // Files that are 'server only' are skipped
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ namespace Utils::IO
|
||||
bool RemoveFile(const std::string& file);
|
||||
std::size_t FileSize(const std::string& file);
|
||||
bool CreateDir(const std::string& dir);
|
||||
bool DirectoryExists(const std::filesystem::path& file);
|
||||
bool DirectoryIsEmpty(const std::filesystem::path& file);
|
||||
bool DirectoryExists(const std::filesystem::path& directory);
|
||||
bool DirectoryIsEmpty(const std::filesystem::path& directory);
|
||||
std::vector<std::string> ListFiles(const std::filesystem::path& directory, bool recursive = false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user