Ejemplo n.º 1
0
        /// <summary>
        /// Replace the list with a new list of servers provided to us by the Steam servers.
        /// </summary>
        /// <param name="endpointList">The <see cref="IPEndPoint"/>s to use for this <see cref="SmartCMServerList"/>.</param>
        public void ReplaceList(IEnumerable <IPEndPoint> endpointList)
        {
            lock ( listLock )
            {
                var distinctEndPoints = endpointList.Distinct().ToArray();

                servers.Clear();

                for (var i = 0; i < distinctEndPoints.Length; i++)
                {
                    AddCore(distinctEndPoints[i]);
                }

                ServerListProvider.UpdateServerListAsync(distinctEndPoints).Wait();
            }
        }