예제 #1
0
        public static void SV_Frame(Int64 msec)
        {
            Globals.time_before_game = Globals.time_after_game = 0;
            if (!SV_INIT.svs.initialized)
            {
                return;
            }
            SV_INIT.svs.realtime += ( Int32 )msec;
            Lib.Rand();
            SV_CheckTimeouts();
            SV_ReadPackets();
            if (0 == SV_MAIN.sv_timedemo.value && SV_INIT.svs.realtime < SV_INIT.sv.time)
            {
                if (SV_INIT.sv.time - SV_INIT.svs.realtime > 100)
                {
                    if (SV_MAIN.sv_showclamp.value != 0)
                    {
                        Com.Printf("sv lowclamp\\n");
                    }
                    SV_INIT.svs.realtime = SV_INIT.sv.time - 100;
                }

                NET.Sleep(SV_INIT.sv.time - SV_INIT.svs.realtime);
                return;
            }

            SV_CalcPings();
            SV_GiveMsec();
            SV_RunGameFrame();
            SV_SEND.SV_SendClientMessages();
            SV_ENTS.SV_RecordDemoMessage();
            Master_Heartbeat();
            SV_PrepWorldFrame();
        }
예제 #2
0
        public static Boolean SV_SendClientDatagram(client_t client)
        {
            SV_ENTS.SV_BuildClientFrame(client);
            SZ.Init(msg, msgbuf, msgbuf.Length);
            msg.allowoverflow = true;
            SV_ENTS.SV_WriteFrameToClient(client, msg);
            if (client.datagram.overflowed)
            {
                Com.Printf("WARNING: datagram overflowed for " + client.name + "\\n");
            }
            else
            {
                SZ.Write(msg, client.datagram.data, client.datagram.cursize);
            }
            SZ.Clear(client.datagram);
            if (msg.overflowed)
            {
                Com.Printf("WARNING: msg overflowed for " + client.name + "\\n");
                SZ.Clear(msg);
            }

            Netchan.Transmit(client.netchan, msg.cursize, msg.data);
            client.message_size[SV_INIT.sv.framenum % Defines.RATE_MESSAGES] = msg.cursize;
            return(true);
        }