public RootDnsInfo GetDnsRecord(string name) { name = name.ToLower(); uint DnsId = new MurmurHash2UInt32Hack().Hash(ASCIIEncoding.Unicode.GetBytes(name)); RootDnsInfo record = null; DnsNames.TryGetValue(DnsId, out record); return(record); }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="DnsId">Only the owner of the DNS must have this to update his IP address</param> /// <returns></returns> public bool ApplyDnsName(string name, ref uint DnsId, SSPClient peer) { name = name.ToLower(); DnsId = new MurmurHash2UInt32Hack().Hash(ASCIIEncoding.Unicode.GetBytes(name)); for (int i = 0; i < DnsNames.Count; i++) { if (DnsNames.Values[i].DnsId == DnsId) { return(false); } } RootDnsInfo dns = new RootDnsInfo(name, DnsId); dns.VirtualIp = peer.VirtualIP; DnsNames.Add(DnsId, dns); return(true); }