CheckNewConnections() public static method

NET_CheckNewConnections
public static CheckNewConnections ( ) : qsocket_t
return qsocket_t
Ejemplo n.º 1
0
        /// <summary>
        /// SV_CheckForNewClients
        /// </summary>
        public static void CheckForNewClients()
        {
            //
            // check for new connections
            //
            while (true)
            {
                qsocket_t ret = Net.CheckNewConnections();
                if (ret == null)
                {
                    break;
                }

                //
                // init a new client structure
                //
                int i;
                for (i = 0; i < svs.maxclients; i++)
                {
                    if (!svs.clients[i].active)
                    {
                        break;
                    }
                }
                if (i == svs.maxclients)
                {
                    Sys.Error("Host_CheckForNewClients: no free clients");
                }

                svs.clients[i].netconnection = ret;
                ConnectClient(i);

                Net.ActiveConnections++;
            }
        }