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);
|
||||
}
|
||||
catch (System.Net.Sockets.SocketException)
|
||||
catch (System.Net.Sockets.SocketException e)
|
||||
{
|
||||
ConfirmationDialogs.CancelPrompt(
|
||||
"Server Creation Failed",
|
||||
"Could not listen on port {0}.\n\nCheck if the port is already being used.".F(Game.Settings.Server.ListenPort),
|
||||
cancelText: "OK");
|
||||
var err_msg = "Could not listen on port {0}.".F(Game.Settings.Server.ListenPort);
|
||||
if (e.ErrorCode == 10048) { // AddressAlreadyInUse (WSAEADDRINUSE)
|
||||
err_msg += "\n\nCheck if the port is already being used.";
|
||||
} else {
|
||||
err_msg += "\n\nError is: \"{0}\" ({1})".F(e.Message, e.ErrorCode);
|
||||
}
|
||||
|
||||
ConfirmationDialogs.CancelPrompt("Server Creation Failed", err_msg, cancelText: "OK");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user