Пример #1
0
 public PeerHandler(string folder)
 {
     _folder = folder;
     if (File.Exists(folder + ".peers"))
     {
         Peers = JsonConvert.DeserializeObject <PeerList>(File.ReadAllText(folder + ".peers"));
     }
 }
Пример #2
0
        public void AddList(PeerList list)
        {
            List <Peer> l   = list.Peers;
            var         res = from x in list.Peers where !Peers.Peers.Contains(x) && Peers.own != x select x;

            foreach (var n in res)
            {
                Peers.Peers.Add(n);
            }
        }
Пример #3
0
 public void AcceptPeers(PacketHeader header, Connection connection, PeerList newPeers)
 {
     handler.AddList(newPeers);
 }