Don't spam logging about missing rewinder

This commit is contained in:
Benau 2022-09-11 00:47:34 +08:00
parent f1fdc98779
commit 8eb8c6392e
3 changed files with 15 additions and 2 deletions

View File

@ -92,9 +92,13 @@ void RewindInfoState::restore()
r = ProjectileManager::get()->addRewinderFromNetworkState(name);
}
if (!r)
{
if (!RewindManager::get()->hasMissingRewinder(name))
{
Log::error("RewindInfoState", "Missing rewinder %s",
name.c_str());
RewindManager::get()->addMissingRewinder(name);
}
m_buffer->skip(data_size);
continue;
}

View File

@ -94,6 +94,7 @@ void RewindManager::reset()
clearExpiredRewinder();
m_rewind_queue.reset();
m_missing_rewinders.clear();
} // reset
// ----------------------------------------------------------------------------

View File

@ -117,6 +117,8 @@ private:
bool m_schedule_reset_network_body;
std::set<std::string> m_missing_rewinders;
RewindManager();
~RewindManager();
// ------------------------------------------------------------------------
@ -220,6 +222,12 @@ public:
void resetSmoothNetworkBody() { m_schedule_reset_network_body = true; }
// ------------------------------------------------------------------------
void handleResetSmoothNetworkBody();
// ------------------------------------------------------------------------
void addMissingRewinder(const std::string& name)
{ m_missing_rewinders.insert(name); }
// ------------------------------------------------------------------------
bool hasMissingRewinder(const std::string& name) const
{ return m_missing_rewinders.find(name) != m_missing_rewinders.end(); }
}; // RewindManager