Remove secondary AllowPortForward setting.

The global setting is fine, and this simplifies
both the code and the UI.
This commit is contained in:
Paul Chote
2017-12-22 13:13:50 +00:00
committed by abcdefg30
parent 38cb3dea05
commit 205c45198c
7 changed files with 14 additions and 84 deletions

View File

@@ -20,15 +20,22 @@ using Open.Nat;
namespace OpenRA.Network
{
public enum UPnPStatus { Enabled, Disabled, NotSupported }
public class UPnP
{
static NatDevice natDevice;
static Mapping mapping;
static bool initialized;
public static IPAddress ExternalIP { get; private set; }
public static UPnPStatus Status { get { return initialized ? natDevice != null ?
UPnPStatus.Enabled : UPnPStatus.NotSupported : UPnPStatus.Disabled; } }
public static async Task DiscoverNatDevices(int timeout)
{
initialized = true;
NatDiscoverer.TraceSource.Switch.Level = SourceLevels.Verbose;
var logChannel = Log.Channel("nat");
NatDiscoverer.TraceSource.Listeners.Add(new TextWriterTraceListener(logChannel.Writer));