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

Fix Now messages sent from a server without clients are recycled

This commit is contained in:
Andrés Leone
2015-12-10 03:03:57 +01:00
parent 1414e34291
commit 8edbf7c424

View File

@@ -25,8 +25,11 @@ namespace Lidgren.Network
public void SendToAll(NetOutgoingMessage msg, NetDeliveryMethod method)
{
var all = this.Connections;
if (all.Count <= 0)
if (all.Count <= 0) {
if (msg.m_isSent == false)
Recycle(msg);
return;
}
SendMessage(msg, all, method, 0);
}
@@ -41,8 +44,11 @@ namespace Lidgren.Network
public void SendToAll(NetOutgoingMessage msg, NetConnection except, NetDeliveryMethod method, int sequenceChannel)
{
var all = this.Connections;
if (all.Count <= 0)
if (all.Count <= 0) {
if (msg.m_isSent == false)
Recycle(msg);
return;
}
if (except == null)
{