コード例 #1
0
        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);
        }
コード例 #2
0
 public void UpdateInfoFromResult(ServerQueryResult serverResult)
 {
     try {
         UpdateInfoFromSettings(serverResult);
     } finally {
         IsUpdating = false;
         Synced     = Tools.Generic.GetCurrentUtcDateTime;
     }
 }
コード例 #3
0
ファイル: ServerList.cs プロジェクト: dkv01/withSIX.Desktop
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        /*
         * 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);
            }
        }