improved handling network errors (show message instead of stopping program)
authorHolger Schemel <info@artsoft.org>
Sat, 29 Sep 2018 09:07:53 +0000 (11:07 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 29 Sep 2018 09:07:53 +0000 (11:07 +0200)
src/network.c

index eb2c5bd01a3dec5d2247a1fc577f9131706320e1..1b9a1386a45cc52381d11282edf3f5028dba92e9 100644 (file)
@@ -284,7 +284,16 @@ boolean ConnectToServer(char *hostname, int port)
     SDLNet_ResolveHost(&ip, hostname, port);
 
     if (ip.host == INADDR_NONE)
-      Error(ERR_EXIT, "cannot locate host '%s'", hostname);
+    {
+      char message[100];
+
+      sprintf(message, "Failed to resolve network server hostname '%s'!",
+             hostname);
+
+      DrawNetworkText_Failed(message);
+
+      return FALSE;
+    }
     else
       server_host = SDLNet_Read32(&ip.host);