codex-5.2: синхронизация ресурсов модов, частичная перезагрузка модов
This commit is contained in:
@@ -7,7 +7,7 @@ namespace LV::Server {
|
||||
ContentManager::ContentManager(AssetsManager &am)
|
||||
: AM(am)
|
||||
{
|
||||
|
||||
std::fill(std::begin(NextId), std::end(NextId), 1);
|
||||
}
|
||||
|
||||
ContentManager::~ContentManager() = default;
|
||||
@@ -111,6 +111,31 @@ void ContentManager::unRegisterModifier(EnumDefContent type, const std::string&
|
||||
ProfileChanges[(int) type].push_back(id);
|
||||
}
|
||||
|
||||
void ContentManager::markAllProfilesDirty(EnumDefContent type) {
|
||||
const auto &table = ContentKeyToId[(int) type];
|
||||
for(const auto& domainPair : table) {
|
||||
for(const auto& keyPair : domainPair.second) {
|
||||
ProfileChanges[(int) type].push_back(keyPair.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<ResourceId> ContentManager::collectProfileIds(EnumDefContent type) const {
|
||||
std::vector<ResourceId> ids;
|
||||
const auto &table = ContentKeyToId[(int) type];
|
||||
|
||||
for(const auto& domainPair : table) {
|
||||
for(const auto& keyPair : domainPair.second) {
|
||||
ids.push_back(keyPair.second);
|
||||
}
|
||||
}
|
||||
|
||||
std::sort(ids.begin(), ids.end());
|
||||
auto last = std::unique(ids.begin(), ids.end());
|
||||
ids.erase(last, ids.end());
|
||||
return ids;
|
||||
}
|
||||
|
||||
ContentManager::Out_buildEndProfiles ContentManager::buildEndProfiles() {
|
||||
Out_buildEndProfiles result;
|
||||
|
||||
@@ -138,4 +163,4 @@ ContentManager::Out_buildEndProfiles ContentManager::buildEndProfiles() {
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user