You've already forked lidgren-network-gen3
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user