Exemplo n.º 1
0
    /// <summary>
    /// Returns a list of responsive server's server info when finished
    /// </summary>
    /// <returns></returns>
    public async System.Threading.Tasks.Task <System.Collections.Generic.List <Steamworks.Data.ServerInfo> > ResponsiveServers()
    {
        var responsive = new System.Collections.Generic.List <Steamworks.Data.ServerInfo>();


        using (var list = new Steamworks.ServerList.LocalNetwork())
        {
            await list.RunQueryAsync();

            foreach (var server in list.Responsive)
            {
                responsive.Add(server);
            }
        }


        using (var list = new Steamworks.ServerList.Internet())
        {
            await list.RunQueryAsync();

            foreach (var server in list.Responsive)
            {
                responsive.Add(server);
            }
        }


        return(responsive);
    }
        public async Task ServerListLan()
        {
            using (var list = new ServerList.LocalNetwork())
            {
                var success = await list.RunQueryAsync();

                Console.WriteLine($"success {success}");
                Console.WriteLine($"Found {list.Responsive.Count} Responsive Servers");
                Console.WriteLine($"Found {list.Unresponsive.Count} Unresponsive Servers");
            }
        }