Beispiel #1
0
        public static void SV_CheckTimeouts( )
        {
            Int32    i;
            client_t cl;
            Int32    droppoint;
            Int32    zombiepoint;

            droppoint   = ( Int32 )(SV_INIT.svs.realtime - 1000 * SV_MAIN.timeout.value);
            zombiepoint = ( Int32 )(SV_INIT.svs.realtime - 1000 * SV_MAIN.zombietime.value);
            for (i = 0; i < SV_MAIN.maxclients.value; i++)
            {
                cl = SV_INIT.svs.clients[i];
                if (cl.lastmessage > SV_INIT.svs.realtime)
                {
                    cl.lastmessage = SV_INIT.svs.realtime;
                }
                if (cl.state == Defines.cs_zombie && cl.lastmessage < zombiepoint)
                {
                    cl.state = Defines.cs_free;
                    continue;
                }

                if ((cl.state == Defines.cs_connected || cl.state == Defines.cs_spawned) && cl.lastmessage < droppoint)
                {
                    SV_SEND.SV_BroadcastPrintf(Defines.PRINT_HIGH, cl.name + " timed out\\n");
                    SV_DropClient(cl);
                    cl.state = Defines.cs_free;
                }
            }
        }
Beispiel #2
0
        public static void SV_Kick_f( )
        {
            if (!SV_INIT.svs.initialized)
            {
                Com.Printf("No server running.\\n");
                return;
            }

            if (Cmd.Argc() != 2)
            {
                Com.Printf("Usage: kick <userid>\\n");
                return;
            }

            if (!SV_SetPlayer())
            {
                return;
            }
            SV_SEND.SV_BroadcastPrintf(Defines.PRINT_HIGH, SV_MAIN.sv_client.name + " was kicked\\n");
            SV_SEND.SV_ClientPrintf(SV_MAIN.sv_client, Defines.PRINT_HIGH, "You were kicked from the game\\n");
            SV_MAIN.SV_DropClient(SV_MAIN.sv_client);
            SV_MAIN.sv_client.lastmessage = SV_INIT.svs.realtime;
        }