X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=net_main.c;h=a7137ab3aea7ea599f1d95bc026904033b6b872e;hp=4c6971d0599c72ba519e80583e8326ecbb7acefb;hb=6d8a43b977296dbaee1af8a032ad3fa8e41700dd;hpb=ea7c24e1fb41f3b1df984ac0eed6881c9fde16f5 diff --git a/net_main.c b/net_main.c index 4c6971d0..a7137ab3 100644 --- a/net_main.c +++ b/net_main.c @@ -162,7 +162,7 @@ static void NET_Listen_f (void) static void MaxPlayers_f (void) { - int n; + int n; if (Cmd_Argc () != 2) { @@ -177,13 +177,9 @@ static void MaxPlayers_f (void) } n = atoi(Cmd_Argv(1)); - if (n < 1) - n = 1; - if (n > svs.maxclientslimit) - { - n = svs.maxclientslimit; + n = bound(1, n, MAX_SCOREBOARD); + if (svs.maxclients != n) Con_Printf ("\"maxplayers\" set to \"%u\"\n", n); - } if ((n == 1) && listening) Cbuf_AddText ("listen 0\n"); @@ -191,7 +187,7 @@ static void MaxPlayers_f (void) if ((n > 1) && (!listening)) Cbuf_AddText ("listen 1\n"); - svs.maxclients = n; + SV_SetMaxClients(n); } @@ -695,7 +691,7 @@ void NET_Init (void) } net_hostport = DEFAULTnet_hostport; - if (COM_CheckParm("-listen") || cls.state == ca_dedicated || gamemode == GAME_BLOODBATH) + if (COM_CheckParm("-listen") || cls.state == ca_dedicated || gamemode == GAME_TRANSFUSION) listening = true; SetNetTime(); @@ -737,14 +733,12 @@ NET_Shutdown ==================== */ -void NET_Shutdown (void) +void NET_Shutdown (void) { - qsocket_t *sock; - SetNetTime(); - for (sock = net_activeSockets; sock; sock = sock->next) - NET_Close(sock); + while (net_activeSockets) + NET_Close(net_activeSockets); // // shutdown the drivers