1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-17 23:56:30 +09:00

Sequence numbers now stored in dictionary per connection to enable sending the same message reliable ordered message to several connections

This commit is contained in:
lidgren
2010-05-20 18:36:19 +00:00
parent 00edeaabf4
commit 046ca06ec6
11 changed files with 84 additions and 79 deletions

View File

@@ -144,14 +144,11 @@ namespace Lidgren.Network
for(int i=0;i<conn.m_storedMessages.Length;i++)
{
List<NetOutgoingMessage> list = conn.m_storedMessages[i];
if (list != null && list.Count > 0)
var dict = conn.m_storedMessages[i];
if (dict != null)
{
foreach (NetOutgoingMessage om in conn.m_storedMessages[i])
{
if (om == msg)
throw new NetException("Ouch! Recycling stored message!");
}
if (dict.ContainsValue(msg))
throw new NetException("Ouch! Recycling stored message!");
}
}
}
@@ -237,7 +234,7 @@ namespace Lidgren.Network
else
retval.Reset();
NetException.Assert(retval.m_status != NetIncomingMessageReleaseStatus.ReleasedToApplication);
NetException.Assert(retval.m_status == NetIncomingMessageReleaseStatus.NotReleased);
retval.m_incomingType = tp;
retval.m_senderConnection = null;
@@ -265,6 +262,8 @@ namespace Lidgren.Network
else
retval.Reset();
NetException.Assert(retval.m_status == NetIncomingMessageReleaseStatus.NotReleased);
retval.m_data = GetStorage(copyLength);
Buffer.BlockCopy(copyFrom, offset, retval.m_data, 0, copyLength);