Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'openmultiplayer:master' into master
Browse files Browse the repository at this point in the history
NexiusTailer authored Oct 24, 2024
2 parents cf1a339 + 596ece7 commit 09b4ed2
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions Server/Source/core_impl.hpp
Original file line number Diff line number Diff line change
@@ -1085,20 +1085,25 @@ class Core final : public ICore, public PlayerConnectEventHandler, public Consol
auto excludeCfg = config.getStrings("exclude");
if (!componentsCfg || componentsCfg->empty())
{
for (auto& de : ghc::filesystem::directory_iterator(path))
for (auto& de : ghc::filesystem::recursive_directory_iterator(path))
{
ghc::filesystem::path p = de.path();
if (p.extension() == LIBRARY_EXT)
{
if (excludeCfg && !excludeCfg->empty())
{
p.replace_extension("");
ghc::filesystem::path rel = ghc::filesystem::relative(p, path);
rel.replace_extension();
// Is this in the "don't load" list?
if (std::find(excludeCfg->begin(), excludeCfg->end(), p.filename().string()) != excludeCfg->end())
const auto isExcluded = [rel = std::move(rel)](const String& exclude)
{
return ghc::filesystem::path(exclude) == rel;
};
if (std::find_if(excludeCfg->begin(), excludeCfg->end(), isExcluded)
!= excludeCfg->end())
{
continue;
}
p.replace_extension(LIBRARY_EXT);
}

IComponent* component = loadComponent(p);
@@ -1121,8 +1126,15 @@ class Core final : public ICore, public PlayerConnectEventHandler, public Consol

if (excludeCfg && !excludeCfg->empty())
{
ghc::filesystem::path rel = ghc::filesystem::relative(file, path);
rel.replace_extension();
// Is this in the "don't load" list?
if (std::find(excludeCfg->begin(), excludeCfg->end(), file.filename().string()) != excludeCfg->end())
const auto isExcluded = [rel = std::move(rel)](const String& exclude)
{
return ghc::filesystem::path(exclude) == rel;
};
if (std::find_if(excludeCfg->begin(), excludeCfg->end(), isExcluded)
!= excludeCfg->end())
{
continue;
}

0 comments on commit 09b4ed2

Please sign in to comment.