Beispiel #1
0
        public ServerSync(ConcurrentDictionary <string, SRClient> connectedClients, HashSet <IPAddress> _bannedIps,
                          IEventAggregator eventAggregator) : base(ServerSettingsStore.Instance.GetServerIP(), ServerSettingsStore.Instance.GetServerPort())
        {
            _clients         = connectedClients;
            this._bannedIps  = _bannedIps;
            _eventAggregator = eventAggregator;
            _eventAggregator.Subscribe(this);
            _serverSettings = ServerSettingsStore.Instance;

            OptionKeepAlive = true;

            if (_serverSettings.GetServerSetting(ServerSettingsKeys.UPNP_ENABLED).BoolValue)
            {
                _natHandler = new NatHandler(_serverSettings.GetServerPort());
                _natHandler.OpenNAT();
            }
        }