1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-06 10:21:09 +09:00

Recycling problems hopefully fully fixed now. Library message now also recycled.

This commit is contained in:
Michael Lidgren
2015-02-07 17:25:54 +01:00
parent 6a0abf25c3
commit 44bc4ff06e
9 changed files with 68 additions and 41 deletions

View File

@@ -73,7 +73,13 @@ namespace ManyServer
var conns = Server.Connections;
// resend to ONE random connection
Server.SendMessage(outMsg, conns[NetRandom.Instance.Next(0, conns.Count)], NetDeliveryMethod.ReliableOrdered, 0);
//Server.SendMessage(outMsg, conns[NetRandom.Instance.Next(0, conns.Count)], NetDeliveryMethod.ReliableOrdered, 0);
List<NetConnection> rec = new List<NetConnection>();
rec.AddRange(conns);
rec.Remove(inc.SenderConnection);
if (rec.Count > 0)
Server.SendMessage(outMsg, rec, NetDeliveryMethod.ReliableOrdered, 0);
break;
}
}

View File

@@ -49,7 +49,6 @@ namespace UnconnectedSample
break;
case NetIncomingMessageType.UnconnectedData:
MainForm.richTextBox1.AppendText("Received from " + im.SenderEndPoint + ": " + im.ReadString() + Environment.NewLine);
Peer.Recycle(im);
break;
}
Peer.Recycle(im);