[BUG] Kicking too much clients at once floods clients

dyn dynborg at vogonhq.com
Sat Nov 17 17:17:51 EST 2007


I swapped sources. Here is correct diff:

--- sv_ccmds.c-1209     2007-11-07 06:45:00.000000000 -0600
+++ sv_ccmds.c  2007-11-17 16:05:22.533248070 -0600
@@ -362,6 +362,7 @@

        cl = SV_GetPlayerByHandle();
        if ( !cl ) {
+               int j = 0;
                if ( !Q_stricmp(Cmd_Argv(1), "all") ) {
                        for ( i=0, cl=svs.clients ; i <
sv_maxclients->integer ; i++,cl++ ) {
                                if ( !cl->state ) {
@@ -371,6 +372,8 @@
                                        continue;
                                }
                                SV_DropClient( cl, "was kicked" );
+                if (++j == 24)
+                    break;
                                cl->lastPacketTime = svs.time;  // in
case there is a funny zombie
                        }
                }
@@ -383,6 +386,8 @@
                                        continue;
                                }
                                SV_DropClient( cl, "was kicked" );
+                if (++j == 24)
+                    break;
                                cl->lastPacketTime = svs.time;  // in
case there is a funny zombie
                        }
                }




On 11/17/07, dyn <dynborg at vogonhq.com> wrote:
> Kicking too much clients at once floods client, usually when you issue
> 'kick allbots' command but it may happen when kicking regular players
> too. Problem is when you kick more than 30 clients other clients
> disconnect with "CL_GetServerCommand: a reliable command was cycled
> out". Server still runs so clients can reconnect.
>
> Workaround is to limit all all-kicks to 24 clients at once. It is safe
> up to 30 clients, but flood may occur now and then, so 24-28 may be
> better. Client rate and maxpackets are irrelevant.
>
> --- sv_ccmds.c  2007-11-17 16:05:22.533248070 -0600
> +++ sv_ccmds.c-1209     2007-11-07 06:45:00.000000000 -0600
> @@ -362,7 +362,6 @@
>
>         cl = SV_GetPlayerByHandle();
>         if ( !cl ) {
> -               int j = 0;
>                 if ( !Q_stricmp(Cmd_Argv(1), "all") ) {
>                         for ( i=0, cl=svs.clients ; i <
> sv_maxclients->integer ; i++,cl++ ) {
>                                 if ( !cl->state ) {
> @@ -372,8 +371,6 @@
>                                         continue;
>                                 }
>                                 SV_DropClient( cl, "was kicked" );
> -                if (++j == 24)
> -                    break;
>                                 cl->lastPacketTime = svs.time;  // in
> case there is a funny zombie
>                         }
>                 }
> @@ -386,8 +383,6 @@
>                                         continue;
>                                 }
>                                 SV_DropClient( cl, "was kicked" );
> -                if (++j == 24)
> -                    break;
>                                 cl->lastPacketTime = svs.time;  // in
> case there is a funny zombie
>                         }
>                 }
>
>
> Credit goes to: DD
> --
> dyn
> http://vogonhq.com/
>


-- 
dyn
http://vogonhq.com/



More information about the quake3 mailing list