fixed problem that the network needed to restart after the network family changed.

only a problem on joining games.
origin
stpohle 22 years ago
parent 31c4bf14cc
commit 33dc3a7a6e

@ -1,4 +1,4 @@
/* $Id: main.c,v 1.18 2003/12/24 02:38:15 stpohle Exp $ */ /* $Id: main.c,v 1.19 2004/01/04 00:24:21 stpohle Exp $ */
#include "basic.h" #include "basic.h"
#include "bomberclone.h" #include "bomberclone.h"
@ -56,7 +56,7 @@ main (int argc, char **argv)
break; break;
} }
} }
gfx_shutdown (); gfx_shutdown ();
return 0; return 0;

@ -194,7 +194,9 @@ void multiplayer_game () {
void void
join_multiplayer_game () join_multiplayer_game ()
{ {
int i; int i, old_ai_family;
old_ai_family = bman.net_ai_family;
multiplayer_firstrun (); multiplayer_firstrun ();
if (network_init () < 0) { if (network_init () < 0) {
@ -202,8 +204,17 @@ join_multiplayer_game ()
return; return;
} }
/* do the serverlist menu and join a server */ net_getserver (); /* show Serverlist */
net_getserver ();
/* if the AI Family Changed, restart the whole network */
if (old_ai_family != bman.net_ai_family) {
network_shutdown ();
if (network_init () < 0) {
d_printf ("network_init () FAILED\n");
return;
}
}
if (bman.servername[0] != 0) { if (bman.servername[0] != 0) {
/* join the server, convert to a usable sockaddr first */ /* join the server, convert to a usable sockaddr first */
network_server_port (bman.servername, players[0].net.addr.host, network_server_port (bman.servername, players[0].net.addr.host,
@ -230,7 +241,7 @@ join_multiplayer_game ()
/* go into the normal multiplayer loop */ /* go into the normal multiplayer loop */
multiplayer_game (); multiplayer_game ();
} }
network_shutdown (); network_shutdown ();
}; };

Loading…
Cancel
Save