You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-06 10:21:09 +09:00
Fixed race condition bug with approval
Changed DestoreMessage call pattern; should effectively be the same tho
This commit is contained in:
@@ -295,8 +295,8 @@ namespace Lidgren.Network
|
|||||||
appMsg.m_senderEndpoint = this.m_remoteEndpoint;
|
appMsg.m_senderEndpoint = this.m_remoteEndpoint;
|
||||||
if (m_remoteHailMessage != null)
|
if (m_remoteHailMessage != null)
|
||||||
appMsg.Write(m_remoteHailMessage.m_data, 0, m_remoteHailMessage.LengthBytes);
|
appMsg.Write(m_remoteHailMessage.m_data, 0, m_remoteHailMessage.LengthBytes);
|
||||||
m_peer.ReleaseMessage(appMsg);
|
|
||||||
SetStatus(NetConnectionStatus.RespondedAwaitingApproval, "Awaiting approval");
|
SetStatus(NetConnectionStatus.RespondedAwaitingApproval, "Awaiting approval");
|
||||||
|
m_peer.ReleaseMessage(appMsg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,8 @@ namespace Lidgren.Network
|
|||||||
{
|
{
|
||||||
//m_connection.m_peer.LogDebug("Using early ack for #" + m_windowStart + "...");
|
//m_connection.m_peer.LogDebug("Using early ack for #" + m_windowStart + "...");
|
||||||
m_receivedAcks[m_windowStart] = false;
|
m_receivedAcks[m_windowStart] = false;
|
||||||
|
DestoreMessage(m_windowStart % m_windowSize);
|
||||||
|
|
||||||
NetException.Assert(m_storedMessages[m_windowStart % m_windowSize].Message == null); // should already be destored
|
NetException.Assert(m_storedMessages[m_windowStart % m_windowSize].Message == null); // should already be destored
|
||||||
m_windowStart = (m_windowStart + 1) % NetConstants.NumSequenceNumbers;
|
m_windowStart = (m_windowStart + 1) % NetConstants.NumSequenceNumbers;
|
||||||
//m_connection.m_peer.LogDebug("Advancing window to #" + m_windowStart);
|
//m_connection.m_peer.LogDebug("Advancing window to #" + m_windowStart);
|
||||||
@@ -196,13 +198,13 @@ namespace Lidgren.Network
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DestoreMessage(seqNr % m_windowSize);
|
|
||||||
m_receivedAcks[seqNr] = true;
|
m_receivedAcks[seqNr] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sendRelate > 0)
|
else if (sendRelate > 0)
|
||||||
{
|
{
|
||||||
// uh... we haven't sent this message yet? Weird, dupe or error...
|
// uh... we haven't sent this message yet? Weird, dupe or error...
|
||||||
|
NetException.Assert(false, "Got ack for message not yet sent?");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user