From: Holger Schemel Date: Wed, 27 Jun 2018 06:37:34 +0000 (+0200) Subject: improved connecting to local network server X-Git-Tag: 4.1.1.0~98 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=5771da1ed1f20e77bfeac44eee6da8cf9894e7a3;p=rocksndiamonds.git improved connecting to local network server --- diff --git a/src/network.c b/src/network.c index e21de8c5..66a57e45 100644 --- a/src/network.c +++ b/src/network.c @@ -297,10 +297,8 @@ boolean ConnectToServer(char *hostname, int port) StartNetworkServer(port); /* wait for server to start up and try connecting several times */ - for (i = 0; i < 6; i++) + for (i = 0; i < 30; i++) { - Delay(500); /* wait 500 ms == 0.5 seconds */ - if ((sfd = SDLNet_TCP_Open(&ip))) /* connected */ { DrawNetworkText_Success("Successfully connected!"); @@ -308,6 +306,8 @@ boolean ConnectToServer(char *hostname, int port) SDLNet_TCP_AddSocket(rfds, sfd); return TRUE; } + + Delay(100); } DrawNetworkText_Failed("Failed to connect to network server!");