Generalize error message when creating a server fails
This commit is contained in:
@@ -119,13 +119,16 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
Game.CreateServer(settings);
|
Game.CreateServer(settings);
|
||||||
}
|
}
|
||||||
catch (System.Net.Sockets.SocketException)
|
catch (System.Net.Sockets.SocketException e)
|
||||||
{
|
{
|
||||||
ConfirmationDialogs.CancelPrompt(
|
var err_msg = "Could not listen on port {0}.".F(Game.Settings.Server.ListenPort);
|
||||||
"Server Creation Failed",
|
if (e.ErrorCode == 10048) { // AddressAlreadyInUse (WSAEADDRINUSE)
|
||||||
"Could not listen on port {0}.\n\nCheck if the port is already being used.".F(Game.Settings.Server.ListenPort),
|
err_msg += "\n\nCheck if the port is already being used.";
|
||||||
cancelText: "OK");
|
} else {
|
||||||
|
err_msg += "\n\nError is: \"{0}\" ({1})".F(e.Message, e.ErrorCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfirmationDialogs.CancelPrompt("Server Creation Failed", err_msg, cancelText: "OK");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user