示例#1
0
        public server(Host host)
        {
            Host = host;

            _Server       = new server_t();
            _ServerStatic = new server_static_t();
        }
示例#2
0
        static Cvar _StopSpeed; // = { "sv_stopspeed", "100" };

        #endregion Fields

        #region Constructors

        static Server()
        {
            _Server = new server_t();
            _ServerStatic = new server_static_t();
        }
示例#3
0
        /// <summary>
        /// Host_FindMaxClients
        /// </summary>
        static void FindMaxClients()
        {
            server_static_t svs = Server.svs;
            client_static_t cls = Client.cls;

            svs.maxclients = 1;

            int i = Common.CheckParm("-dedicated");

            if (i > 0)
            {
                cls.state = cactive_t.ca_dedicated;
                if (i != (Common.Argc - 1))
                {
                    svs.maxclients = Common.atoi(Common.Argv(i + 1));
                }
                else
                {
                    svs.maxclients = 8;
                }
            }
            else
            {
                cls.state = cactive_t.ca_disconnected;
            }

            i = Common.CheckParm("-listen");
            if (i > 0)
            {
                if (cls.state == cactive_t.ca_dedicated)
                {
                    Sys.Error("Only one of -dedicated or -listen can be specified");
                }
                if (i != (Common.Argc - 1))
                {
                    svs.maxclients = Common.atoi(Common.Argv(i + 1));
                }
                else
                {
                    svs.maxclients = 8;
                }
            }
            if (svs.maxclients < 1)
            {
                svs.maxclients = 8;
            }
            else if (svs.maxclients > QDef.MAX_SCOREBOARD)
            {
                svs.maxclients = QDef.MAX_SCOREBOARD;
            }

            svs.maxclientslimit = svs.maxclients;
            if (svs.maxclientslimit < 4)
            {
                svs.maxclientslimit = 4;
            }
            svs.clients = new client_t[svs.maxclientslimit]; // Hunk_AllocName (svs.maxclientslimit*sizeof(client_t), "clients");
            for (i = 0; i < svs.clients.Length; i++)
            {
                svs.clients[i] = new client_t();
            }

            if (svs.maxclients > 1)
            {
                Cvar.Set("deathmatch", 1.0f);
            }
            else
            {
                Cvar.Set("deathmatch", 0.0f);
            }
        }
示例#4
0
 static Server()
 {
     _Server       = new server_t();
     _ServerStatic = new server_static_t();
 }