Ejemplo n.º 1
0
        public static void ReadPackets()
        {
            while (NET.GetPacket(NetSrc.NS_SERVER))
            {
                if (SV.FilterPacket())
                {
                    SV.SendBan();
                }
                else
                {
                    //       if PInt32(NetMessage.Data) ^ = OUTOFBAND_TAG then
                    //          SV.ConnectionlessPacket()
                    //      else
                    for (int i = 0; i < Global.SVS.MaxClients; i++)
                    {
                        Client C = null;
                        //C := @SVS.Clients[I];
                        if ((C.Active || C.Spawned || C.Connected) && NET.CompareAdr(Global.NetFrom, C.netchan.Addr))
                        {
                            if (Netchan.Process(ref C.netchan))
                            {
                                if ((Global.SVS.MaxClients == 1) || !C.Active || !C.Spawned || !C.SendInfo)
                                {
                                    C.NeedUpdate = true;
                                }

                                SV.ExecuteClientMessage(ref C);
                                Global.GlobalVars.FrameTime = (float)Global.HostFrameTime;
                            }

                            if (Netchan.IncomingReady(C.netchan))
                            {
                                if (Netchan.CopyNormalFragments(ref C.netchan))
                                {
                                    MSG.BeginReading();
                                    SV.ExecuteClientMessage(ref C);
                                }

                                if (Netchan.CopyFileFragments(ref C.netchan))
                                {
                                    //  Global.HostClient = C;
                                    SV.ProcessFile(ref C, C.netchan.FileName);
                                }
                            }

                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static void Init()
        {
            Global.RealTime = 0.0;

            Trash.Rand_Init();
            CBuf.Init();
            Cmd.Init();
            CVar.Init();
            InitLocal();
            ClearSaveDirectory();
            Con.Init();
            HPAK.Init();

            SV.SetMaxClients();
            W.LoadWADFile();
            Decal.Init();
            Mod.Init();
            R.Init();
            NET.Init();
            Netchan.Init();
            Delta.Init();
            SV.Init();

            string buf = "asdasd"; // TODO

            CVar.DirectSet(ref Global.sv_version, buf);

            HPAK.CheckIntegrity("custom.hpk");
            CBuf.InsertText("exec valve.rc\n");
            Hunk.AllocName(0, "-HOST_HUNKLEVEL-");
            Global.HostHunkLevel = Hunk.LowMark;

            Global.HostActive    = 1;
            Global.HostNumFrames = 0;

            Global.HostTimes.Prev = Sys.FloatTime();
            Global.HostInit       = true;
        }
Ejemplo n.º 3
0
 public static bool CopyNormalFragments(ref Netchan c)
 {
     return(false);
 }
Ejemplo n.º 4
0
        // public static void Transmit(ref Netchan c, uint Size; Buffer: Pointer);

        public static bool IncomingReady(Netchan c)
        {
            return(false);
        }
Ejemplo n.º 5
0
        //  public static void FlushIncoming(ref Netchan c; Stream: TNetStream);

        // public static void Setup(NetSrc source, ref Netchan c, NetAdr addr, int ClientID; ClientPtr: PClient; Func: TFragmentSizeFunc);

        public static bool Process(ref Netchan c)
        {
            return(false);
        }
Ejemplo n.º 6
0
        //  public static void CreateFragments(ref Netchan c; var SB: TSizeBuf) { }
        //  public static void CreateFileFragmentsFromBuffer(ref Netchan c; Name: PLChar; Buffer: Pointer; Size: UInt) { }

        public static bool CreateFileFragments(ref Netchan c, string name)
        {
            return(false);
        }
Ejemplo n.º 7
0
        // public static void AddBufferToList(var Base: PFragBuf; P: PFragBuf);

        public static void Clear(ref Netchan c)
        {
        }
Ejemplo n.º 8
0
 public static void FragSend(ref Netchan c)
 {
 }
Ejemplo n.º 9
0
 public static bool CanPacket(ref Netchan c)
 {
     return(false);
 }
Ejemplo n.º 10
0
 public static bool CopyFileFragments(ref Netchan c)
 {
     return(false);
 }