This commit is contained in:
2025-09-10 21:09:37 +06:00
parent e74e623c0b
commit 4bdbbdbe2f
5 changed files with 205 additions and 108 deletions

View File

@@ -761,6 +761,7 @@ void ServerSession::update(GlobalTime gTime, float dTime) {
auto iter = MyAssets.NotInUse[(int) entry.Type].find(entry.Domain+':'+entry.Key);
if(iter != MyAssets.NotInUse[(int) entry.Type].end()) {
IServerSession::Assets[entry.Type][entry.Id] = std::get<0>(iter->second);
result.Assets_ChangeOrAdd[entry.Type].push_back(entry.Id);
MyAssets.NotInUse[(int) entry.Type].erase(iter);
}
}
@@ -774,6 +775,7 @@ void ServerSession::update(GlobalTime gTime, float dTime) {
if(iter != IServerSession::Assets[(EnumAssets) type].end()) {
MyAssets.NotInUse[(int) iter->second.Type][iter->second.Domain+':'+iter->second.Key] = {iter->second, TIME_BEFORE_UNLOAD_RESOURCE+time(nullptr)};
IServerSession::Assets[(EnumAssets) type].erase(iter);
result.Assets_Lost[iter->second.Type].push_back(iter->second.Id);
}
}
@@ -787,6 +789,7 @@ void ServerSession::update(GlobalTime gTime, float dTime) {
if(MyAssets.ExistBinds[(int) entry.Type].contains(entry.Id)) {
// Ресурс ещё нужен
IServerSession::Assets[entry.Type][entry.Id] = entry;
result.Assets_ChangeOrAdd[entry.Type].push_back(entry.Id);
} else {
// Ресурс уже не нужен, отправляем в кеш
MyAssets.NotInUse[(int) entry.Type][entry.Domain+':'+entry.Key] = {entry, TIME_BEFORE_UNLOAD_RESOURCE+time(nullptr)};