Added generic delayed update objects
This commit is contained in:
parent
ceafbf8bb6
commit
d266508bbf
14 changed files with 176 additions and 43 deletions
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue