You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-17 15:46:33 +09:00
Unconnected messages now marked as sent when sending
This commit is contained in:
@@ -277,14 +277,11 @@ namespace Lidgren.Network
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendUnconnectedMessage(NetOutgoingMessage msg, string host, int port)
|
public void SendUnconnectedMessage(NetOutgoingMessage msg, string host, int port)
|
||||||
{
|
{
|
||||||
if (msg.IsSent)
|
|
||||||
throw new NetException("Message has already been sent!");
|
|
||||||
|
|
||||||
IPAddress adr = NetUtility.Resolve(host);
|
IPAddress adr = NetUtility.Resolve(host);
|
||||||
if (adr == null)
|
if (adr == null)
|
||||||
throw new NetException("Failed to resolve " + host);
|
throw new NetException("Failed to resolve " + host);
|
||||||
|
|
||||||
EnqueueUnconnectedMessage(msg, new IPEndPoint(adr, port));
|
SendUnconnectedMessage(msg, new IPEndPoint(adr, port));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -294,6 +291,8 @@ namespace Lidgren.Network
|
|||||||
{
|
{
|
||||||
if (msg.IsSent)
|
if (msg.IsSent)
|
||||||
throw new NetException("Message has already been sent!");
|
throw new NetException("Message has already been sent!");
|
||||||
|
msg.m_wasSent = true;
|
||||||
|
|
||||||
EnqueueUnconnectedMessage(msg, recipient);
|
EnqueueUnconnectedMessage(msg, recipient);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,6 +303,8 @@ namespace Lidgren.Network
|
|||||||
{
|
{
|
||||||
if (msg.IsSent)
|
if (msg.IsSent)
|
||||||
throw new NetException("Message has already been sent!");
|
throw new NetException("Message has already been sent!");
|
||||||
|
msg.m_wasSent = true;
|
||||||
|
|
||||||
foreach (IPEndPoint rec in recipients)
|
foreach (IPEndPoint rec in recipients)
|
||||||
EnqueueUnconnectedMessage(msg, rec);
|
EnqueueUnconnectedMessage(msg, rec);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user