mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-06-17 14:12:25 +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
+2
-1
@@ -166,10 +166,11 @@ bool TTCPServer::TCPSend(TClient& c, const std::string& Data, bool IsSync) {
|
|||||||
c.EnqueueMissedPacketDuringSyncing(Data);
|
c.EnqueueMissedPacketDuringSyncing(Data);
|
||||||
return true;
|
return true;
|
||||||
} else if (!c.IsSyncing() && c.IsSynced() && c.MissedPacketQueueSize() != 0) {
|
} else if (!c.IsSyncing() && c.IsSynced() && c.MissedPacketQueueSize() != 0) {
|
||||||
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
while (c.MissedPacketQueueSize() > 0) {
|
while (c.MissedPacketQueueSize() > 0) {
|
||||||
std::string QData = c.MissedPacketQueue().front();
|
std::string QData = c.MissedPacketQueue().front();
|
||||||
c.MissedPacketQueue().pop();
|
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);
|
TCPSend(c, QData, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user