Доработка менеджера контента на стороне сервера под новый провайдер идентификаторов

This commit is contained in:
2026-01-16 01:05:20 +06:00
parent 16a0fa5f7a
commit 49c4d77c59
5 changed files with 316 additions and 234 deletions

View File

@@ -7,7 +7,6 @@ namespace LV::Server {
ContentManager::ContentManager(AssetsManager& am)
: AM(am)
{
std::fill(std::begin(NextId), std::end(NextId), 1);
}
ContentManager::~ContentManager() = default;
@@ -124,30 +123,13 @@ void ContentManager::unRegisterModifier(EnumDefContent type, const std::string&
}
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);
}
const auto &table = this->idToDK()[(int) type];
size_t counter = 0;
for(const auto& [domain, key] : table) {
ProfileChanges[static_cast<size_t>(type)].push_back(counter++);
}
}
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;
@@ -156,6 +138,8 @@ ContentManager::Out_buildEndProfiles ContentManager::buildEndProfiles() {
std::sort(keys.begin(), keys.end());
auto iterErase = std::unique(keys.begin(), keys.end());
keys.erase(iterErase, keys.end());
}
return result;