Implement IPv6 support for server and direct connect

This commit is contained in:
jrb0001
2020-01-06 22:19:52 +01:00
committed by reaperrr
parent bd1a936c7a
commit bf397591f9
16 changed files with 328 additions and 118 deletions

View File

@@ -11,7 +11,6 @@
using System;
using System.Linq;
using System.Net;
using OpenRA.Network;
using OpenRA.Primitives;
using OpenRA.Widgets;
@@ -199,7 +198,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
// Create and join the server
try
{
Game.CreateServer(settings);
var endpoint = Game.CreateServer(settings);
Ui.CloseWindow();
ConnectionLogic.Connect(endpoint, password, onCreate, onExit);
}
catch (System.Net.Sockets.SocketException e)
{
@@ -212,11 +214,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
message += "\nError is: \"{0}\" ({1})".F(e.Message, e.ErrorCode);
ConfirmationDialogs.ButtonPrompt("Server Creation Failed", message, onCancel: () => { }, cancelText: "Back");
return;
}
Ui.CloseWindow();
ConnectionLogic.Connect(IPAddress.Loopback.ToString(), Game.Settings.Server.ListenPort, password, onCreate, onExit);
}
}
}