Added generic delayed update objects

This commit is contained in:
Yousef Khadadeh 2025-12-10 17:23:05 +03:00
parent ceafbf8bb6
commit d266508bbf
14 changed files with 176 additions and 43 deletions

View file

@ -0,0 +1,13 @@
#include "DelayUpdateSerializedClassManager.hpp"
namespace NetworkingObjects {
void DelayUpdateSerializedClassManager::update() {
std::erase_if(updatingObjs, [](auto& updatingPair) {
if((std::chrono::steady_clock::now() - updatingPair.second.lastUpdateTimePoint) >= std::chrono::seconds(3)) {
updatingPair.second.setDataAfterTimeout();
return true;
}
return false;
});
}
}