Пример #1
0
        public static DhtClient FromBytes(byte[] data, int start)
        {
            DhtClient result = new DhtClient();

            result.UserID   = BitConverter.ToUInt64(data, start);
            result.ClientID = BitConverter.ToUInt16(data, start + 8);
            return(result);
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            DhtClient compare = obj as DhtClient;

            if (compare == null)
            {
                return(false);
            }

            return(UserID == compare.UserID && ClientID == compare.ClientID);
        }
Пример #3
0
        public static CrawlRequest Decode(G2ReceivedPacket packet)
        {
            CrawlRequest request = new CrawlRequest();

            G2Header child = new G2Header(packet.Root.Data);

            while (G2Protocol.ReadNextChild(packet.Root, child) == G2ReadResult.PACKET_GOOD)
            {
                if (!G2Protocol.ReadPayload(child))
                {
                    continue;
                }

                switch (child.Name)
                {
                case Packet_Target:
                    request.Target = DhtClient.FromBytes(child.Data, child.PayloadPos);
                    break;
                }
            }

            return(request);
        }
Пример #4
0
 public TunnelAddress(DhtClient client, ushort id)
 {
     UserID   = client.UserID;
     ClientID = client.ClientID;
     TunnelID = id;
 }
Пример #5
0
 public DhtClient(DhtClient copy)
 {
     UserID   = copy.UserID;
     ClientID = copy.ClientID;
 }