Ignore invalid server entries instead of the entire list.
This commit is contained in:
@@ -334,14 +334,24 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
List<GameServer> games = null;
|
List<GameServer> games = null;
|
||||||
if (i.Error == null)
|
if (i.Error == null)
|
||||||
{
|
{
|
||||||
|
games = new List<GameServer>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var data = Encoding.UTF8.GetString(i.Result);
|
var data = Encoding.UTF8.GetString(i.Result);
|
||||||
var yaml = MiniYaml.FromString(data);
|
var yaml = MiniYaml.FromString(data);
|
||||||
|
foreach (var node in yaml)
|
||||||
games = yaml.Select(a => new GameServer(a.Value))
|
{
|
||||||
.Where(gs => gs.Address != null)
|
try
|
||||||
.ToList();
|
{
|
||||||
|
var gs = new GameServer(node.Value);
|
||||||
|
if (gs.Address != null)
|
||||||
|
games.Add(gs);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// Ignore any invalid games advertised.
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user