Доработка менеджера контента на стороне сервера под новый провайдер идентификаторов
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user