Пример #1
0
            public PeerConnection(string name, string host, RijndaelManaged c, AuthDB db)
            {
                Connection = new JsonClient(host);

                Name   = name;
                Crypto = c;
                DB     = db;

                if (Crypto != null)
                {
                    Encrypter = Crypto.CreateEncryptor();
                }
            }
Пример #2
0
        public Server(AuthConfig cfg)
        {
            Config = cfg;

            Prefixes = Config.ListenPrefixes;
            DB       = GetAuthDB();
            DB.Startup(cfg.AuthDBLocation);

            this.MessageProcessor = ProcessAuthMessage;

            foreach (var o in cfg.OutboundUpdatePeers)
            {
                var p = new PeerConnection(o.Name, o.Host, Encryption.BuildCrypto(o.APIKey), DB);
                PeerConnections.Add(o.Name, p);
            }
        }