X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fnetserv.c;h=1f0663fdd71fbaa292118c7d6a18ab8fb1f99ce6;hb=7bcc6aa833d64b21f78793dd00ed4c1356b98d05;hp=e94304d29cc9e14adb5f19d3ab460931413b0791;hpb=a99a1803e5097bc598b4c6f73259715da148ab27;p=rocksndiamonds.git diff --git a/src/netserv.c b/src/netserv.c index e94304d2..1f0663fd 100644 --- a/src/netserv.c +++ b/src/netserv.c @@ -819,6 +819,8 @@ static void ExitNetworkServer(int exit_value) // the pointer points to an integer containing the port-number int NetworkServerThread(void *ptr) { + network.is_server_thread = TRUE; + NetworkServer(*((int *) ptr), 0); // should never be reached @@ -862,28 +864,22 @@ void NetworkServer(int port, int serveronly) #endif if (SDLNet_ResolveHost(&ip, NULL, port) == -1) - Error(ERR_EXIT_NETWORK_SERVER, "SDLNet_ResolveHost() failed: %s", - SDLNet_GetError()); + Fail("SDLNet_ResolveHost() failed: %s", SDLNet_GetError()); if ((fds = SDLNet_AllocSocketSet(MAX_PLAYERS + 1 + 1)) == NULL) - Error(ERR_EXIT_NETWORK_SERVER, "SDLNet_AllocSocketSet() failed: %s"), - SDLNet_GetError(); + Fail("SDLNet_AllocSocketSet() failed: %s"), SDLNet_GetError(); if ((lfd = SDLNet_TCP_Open(&ip)) == NULL) - Error(ERR_EXIT_NETWORK_SERVER, "SDLNet_TCP_Open() failed: %s"), - SDLNet_GetError(); + Fail("SDLNet_TCP_Open() failed: %s"), SDLNet_GetError(); if (SDLNet_TCP_AddSocket(fds, lfd) == -1) - Error(ERR_EXIT_NETWORK_SERVER, "SDLNet_TCP_AddSocket() failed: %s"), - SDLNet_GetError(); + Fail("SDLNet_TCP_AddSocket() failed: %s"), SDLNet_GetError(); if ((udp = SDLNet_UDP_Open(port)) == NULL) - Error(ERR_EXIT_NETWORK_SERVER, "SDLNet_UDP_Open() failed: %s", - SDLNet_GetError()); + Fail("SDLNet_UDP_Open() failed: %s", SDLNet_GetError()); if (SDLNet_UDP_AddSocket(fds, udp) == -1) - Error(ERR_EXIT_NETWORK_SERVER, "SDLNet_TCP_AddSocket() failed: %s"), - SDLNet_GetError(); + Fail("SDLNet_TCP_AddSocket() failed: %s"), SDLNet_GetError(); Debug("network:server", "started up, listening on port %d", port); Debug("network:server", "using protocol version %d.%d.%d",