Fix dedicated server crash with AllowPortForward.

This commit is contained in:
Paul Chote
2016-10-30 15:31:03 +00:00
parent 7ba0c22346
commit bbe4864921
3 changed files with 5 additions and 6 deletions

View File

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