private static void MapServer(Action <Server> act, ServerQueryResult x) { var r = (SourceParseResult)x.Settings; // TODO: Why not map from x instead? var serverInfo = r.MapTo <ArmaServer>(); serverInfo.Ping = x.Ping; act(serverInfo); }
public void UpdateInfoFromResult(ServerQueryResult serverResult) { try { UpdateInfoFromSettings(serverResult); } finally { IsUpdating = false; Synced = Tools.Generic.GetCurrentUtcDateTime; } }
void UpdateOrAddServer(ICollection <Server> servers, ServerQueryResult s) { var server = servers.FirstOrDefault(x => x.Address.ToString().Equals(s.Settings["address"])); if (server == null) { servers.Add(server = Game.CreateServer(new ServerAddress(s.Settings["address"]))); } server.UpdateInfoFromSettings(s); }
private static void MapServerInclPlayers(Action <Server> act, ServerQueryResult x) { var r = (SourceParseResult)x.Settings; // TODO: Why not map from x instead? var serverInfo = r.MapTo <ArmaServerWithPlayers>(); serverInfo.Ping = x.Ping; serverInfo.Players = x.Players.OfType <SourcePlayer>().ToList(); act(serverInfo); }
/* * void TryDetermineCountry() { * try { * DetermineCountry(); * } catch (Exception e) { * this.Logger().FormattedErrorException(e); * } * } */ public void UpdateInfoFromSettings(ServerQueryResult result) { ServerMapper.Instance.Map(result, this); var game = (Game)_game; var modSet = game.CalculatedSettings.Collection; IsOfficial = GetIsOfficial(modSet); IsFeatured = GetIsFeatured(modSet); if (IsFavorite) { DomainEvilGlobal.Settings.ServerOptions.UpdateFavorite(this); } }