public PeerHandler(string folder) { _folder = folder; if (File.Exists(folder + ".peers")) { Peers = JsonConvert.DeserializeObject <PeerList>(File.ReadAllText(folder + ".peers")); } }
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); } }
public void AcceptPeers(PacketHeader header, Connection connection, PeerList newPeers) { handler.AddList(newPeers); }