예제 #1
0
        public bool SendPacket(Packet packet, uint dwIP, ushort nPort, bool bEncrypt,
                               byte[] pachTargetClientHashORKadID, bool bKad, uint nReceiverVerifyKey)
        {
            UDPPack newpending = new UDPPack();

            newpending.dwIP     = dwIP;
            newpending.nPort    = nPort;
            newpending.packet   = packet;
            newpending.dwTime   = MpdUtilities.GetTickCount();
            newpending.bEncrypt =
                bEncrypt &&
                (pachTargetClientHashORKadID != null ||
                 (bKad && nReceiverVerifyKey != 0));
            newpending.bKad = bKad;
            newpending.nReceiverVerifyKey = nReceiverVerifyKey;

            if (newpending.bEncrypt && pachTargetClientHashORKadID != null)
            {
                MpdUtilities.Md4Cpy(newpending.pachTargetClientHashORKadID, pachTargetClientHashORKadID);
            }
            else
            {
                MpdUtilities.Md4Clr(newpending.pachTargetClientHashORKadID);
            }
            lock (sendLocker_)
            {
                controlpacketQueue_.Add(newpending);
            }// sendLocker.Unlock();

            MuleApplication.Instance.UploadBandwidthThrottler.QueueForSendingControlPacket(this);
            return(true);
        }
예제 #2
0
 public DeadSource(uint dwID, ushort nPort, uint dwServerIP, ushort nKadPort)
 {
     id_       = dwID;
     serverIP_ = dwServerIP;
     port_     = nPort;
     kadPort_  = nKadPort;
     MpdUtilities.Md4Clr(hash_);
 }
예제 #3
0
파일: MapKey.cs 프로젝트: mheydt/mpddotnet
 public MapSKey(byte[] key)
 {
     if (key != null)
     {
         MpdUtilities.Md4Cpy(key_, key);
     }
     else
     {
         MpdUtilities.Md4Clr(key_);
     }
 }
예제 #4
0
 protected FileIdentifierBaseImpl()
 {
     MpdUtilities.Md4Clr(md4Hash_);
     HasAICHHash = false;
 }