mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-04 23:06:08 +00:00
add 1 second delay before we start sending missed data during sync
This commit is contained in:
committed by
Anonymous275
parent
3c48ac6145
commit
83145d7466
@@ -166,10 +166,11 @@ bool TTCPServer::TCPSend(TClient& c, const std::string& Data, bool IsSync) {
|
||||
c.EnqueueMissedPacketDuringSyncing(Data);
|
||||
return true;
|
||||
} else if (!c.IsSyncing() && c.IsSynced() && c.MissedPacketQueueSize() != 0) {
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
while (c.MissedPacketQueueSize() > 0) {
|
||||
std::string QData = c.MissedPacketQueue().front();
|
||||
c.MissedPacketQueue().pop();
|
||||
debug("sending a missed packet of size " + std::to_string(QData.size()));
|
||||
debug("sending a missed packet: " + QData);
|
||||
TCPSend(c, QData, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user