Migrate to Open.Nat version 2.0.16

Move the dependency from all libraries to game engine only.
Initialize after the renderer setup to ensure a visible window.
This commit is contained in:
Matthias Mailänder
2016-05-15 11:27:15 +02:00
parent 38295341a8
commit 5245df729d
15 changed files with 81 additions and 155 deletions

View File

@@ -137,7 +137,7 @@ namespace OpenRA.Server
randomSeed = (int)DateTime.Now.ToBinary();
if (Settings.AllowPortForward)
UPnP.ForwardPort(3600);
UPnP.ForwardPort(Settings.ListenPort, Settings.ExternalPort).Wait();
foreach (var trait in modData.Manifest.ServerTraits)
serverTraits.Add(modData.ObjectCreator.CreateObject<ServerTrait>(trait));
@@ -202,7 +202,8 @@ namespace OpenRA.Server
if (State == ServerState.ShuttingDown)
{
EndGame();
if (Settings.AllowPortForward) UPnP.RemovePortforward();
if (Settings.AllowPortForward)
UPnP.RemovePortForward().Wait();
break;
}
}