Exemplo n.º 1
0
        public Server(ISupportServers game, ServerAddress address)
        {
            if (game == null)
            {
                throw new ArgumentNullException(nameof(game));
            }
            if (address == null)
            {
                throw new ArgumentNullException(nameof(address));
            }

            Children = new ReactiveList <IHierarchicalLibraryItem>();

            _game       = game;
            Players     = new Player[0];
            _mods       = new string[0];
            _signatures = new string[0];

            Address = address;
            SetServerAddress(address.GetArmaServerPort().Port);

            _isFavorite    = DomainEvilGlobal.Settings.ServerOptions.IsFavorite(this);
            _savedPassword = DomainEvilGlobal.Settings.ServerOptions.GetPassword(this);
            if (_savedPassword != null)
            {
                _savePassword = true;
            }
            //TryDetermineCountry();
        }
Exemplo n.º 2
0
        static Server CreateServerFromStored(ISupportServers game, IServerBla stored,
                                             IDictionary <string, string> settings)
        {
            var server = game.CreateServer(stored.Address);

            server.UpdateInfoFromResult(CreateQueryResult(stored.QueryMode, settings));
            return(server);
        }
Exemplo n.º 3
0
        public static async Task <SourceServersQuery> FakeSourceServerQuery(this IGameServerQueryHandler mediator,
                                                                            ISupportServers game)
        {
            SourceServersQuery parameters = null;

            A.CallTo(() => mediator.Query(A <SourceServersQuery> ._))
            .Invokes((SourceServersQuery x) => parameters = x)
            .ReturnsLazily(() => Task.FromResult(default(IEnumerable <ServerQueryResult>)));
            await game.QueryServers(mediator);

            return(parameters);
        }
Exemplo n.º 4
0
 public ServerList(ISupportServers game, UserSettings settings, IEventAggregator eventBus,
                   IGameServerQueryHandler queryHandler, IGameContext gameContext)
 {
     _eventBus        = eventBus;
     _queryHandler    = queryHandler;
     _gameContext     = gameContext;
     _settings        = settings;
     _listTimer       = new TimerWithElapsedCancellationAsync(GetTimerValue(), ListTimerElapsed, null);
     _serverTimer     = new TimerWithElapsedCancellationAsync(ServerUpdateFrequency, ServerTimerElapsed);
     Game             = game;
     Filter           = Game.GetServerFilter();
     ServerQueryQueue = new ServerQueryQueue();
 }
Exemplo n.º 5
0
 IDisposable SetupServerFilters(ISupportServers game)
 {
     ServerFilter = game.GetServerFilter();
     return(ServerFilter.FilterChanged.Subscribe(x => RefreshFilterCommand.Execute(null)));
 }
Exemplo n.º 6
0
 public static Server FromStored(ISupportServers game, IServerBla stored) => CreateServerFromStored(game, stored, ToDict(stored));