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

@@ -134,8 +134,7 @@ namespace OpenRA.Server
randomSeed = (int)DateTime.Now.ToBinary();
// UPnP is only supported for servers created by the game client.
if (!dedicated && Settings.AllowPortForward)
if (UPnP.Status == UPnPStatus.Enabled)
UPnP.ForwardPort(Settings.ListenPort, Settings.ExternalPort).Wait();
foreach (var trait in modData.Manifest.ServerTraits)
@@ -206,7 +205,7 @@ namespace OpenRA.Server
if (State == ServerState.ShuttingDown)
{
EndGame();
if (!dedicated && Settings.AllowPortForward)
if (UPnP.Status == UPnPStatus.Enabled)
UPnP.RemovePortForward().Wait();
break;
}