1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-17 15:46:33 +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) public void SendToAll(NetOutgoingMessage msg, NetDeliveryMethod method)
{ {
var all = this.Connections; var all = this.Connections;
if (all.Count <= 0) if (all.Count <= 0) {
if (msg.m_isSent == false)
Recycle(msg);
return; return;
}
SendMessage(msg, all, method, 0); SendMessage(msg, all, method, 0);
} }
@@ -41,8 +44,11 @@ namespace Lidgren.Network
public void SendToAll(NetOutgoingMessage msg, NetConnection except, NetDeliveryMethod method, int sequenceChannel) public void SendToAll(NetOutgoingMessage msg, NetConnection except, NetDeliveryMethod method, int sequenceChannel)
{ {
var all = this.Connections; var all = this.Connections;
if (all.Count <= 0) if (all.Count <= 0) {
if (msg.m_isSent == false)
Recycle(msg);
return; return;
}
if (except == null) if (except == null)
{ {