Merge pull request #704 from diamante0018/develop
[Download]: Fix listing of files
This commit is contained in:
commit
a4598db670
@ -466,16 +466,12 @@ namespace Components
|
|||||||
std::vector<nlohmann::json> fileList;
|
std::vector<nlohmann::json> fileList;
|
||||||
|
|
||||||
const auto path = (*Game::fs_basepath)->current.string / fsGame;
|
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");
|
list.emplace_back("mod.ff");
|
||||||
|
|
||||||
for (const auto& file : list)
|
for (const auto& file : list)
|
||||||
{
|
{
|
||||||
auto filename = path / file;
|
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
|
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);
|
bool RemoveFile(const std::string& file);
|
||||||
std::size_t FileSize(const std::string& file);
|
std::size_t FileSize(const std::string& file);
|
||||||
bool CreateDir(const std::string& dir);
|
bool CreateDir(const std::string& dir);
|
||||||
bool DirectoryExists(const std::filesystem::path& file);
|
bool DirectoryExists(const std::filesystem::path& directory);
|
||||||
bool DirectoryIsEmpty(const std::filesystem::path& file);
|
bool DirectoryIsEmpty(const std::filesystem::path& directory);
|
||||||
std::vector<std::string> ListFiles(const std::filesystem::path& directory, bool recursive = false);
|
std::vector<std::string> ListFiles(const std::filesystem::path& directory, bool recursive = false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user