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

UPnP support added: get external ip, add forwarding rule and delete forwarding rule

This commit is contained in:
lidgren
2011-04-27 20:52:29 +00:00
parent b575f72186
commit 713d91ac58
7 changed files with 353 additions and 112 deletions

View File

@@ -39,6 +39,7 @@ namespace Lidgren.Network
internal float m_pingInterval;
internal bool m_useMessageRecycling;
internal float m_connectionTimeout;
internal bool m_enableUPnP;
internal NetIncomingMessageType m_disabledTypes;
internal int m_port;
@@ -243,6 +244,20 @@ namespace Lidgren.Network
}
}
/// <summary>
/// Enables UPnP support; enabling port forwarding and getting external ip
/// </summary>
public bool EnableUPnP
{
get { return m_enableUPnP; }
set
{
if (m_isLocked)
throw new NetException(c_isLockedMessage);
m_enableUPnP = value;
}
}
/// <summary>
/// Gets or sets the local ip address to bind to. Defaults to IPAddress.Any. Cannot be changed once NetPeer is initialized.
/// </summary>