send map when arriving late

This commit is contained in:
2025-08-22 12:24:58 +02:00
parent 688b6e93ea
commit 5b6254c690
12 changed files with 52 additions and 16 deletions

View File

@@ -47,6 +47,16 @@ protocol::packets::LockStepResponsePacket ServerSimulation::GetResponse(
return {result};
}
std::vector<protocol::LockStep> ServerSimulation::GetFirstLocksteps() {
std::vector<protocol::LockStep> result;
if (m_CurrentTime <= LOCKSTEP_BUFFER_SIZE)
return result;
result.reserve(m_CurrentTime);
result.insert(result.begin(), m_History.begin(), m_History.begin() + m_CurrentTime);
return result;
}
} // namespace sim
} // namespace td