예제 #1
0
        public override void HandlePacket(ecProto.ecPacket packet)
        {
            ECOpCodes op = packet.Opcode();

            switch (op)
            {
            case ECOpCodes.EC_OP_STATS:
                m_owner.StatsReplyInvoke(packet);
                break;

            case ECOpCodes.EC_OP_DLOAD_QUEUE:
                m_owner.DloadQueueReply(packet);
                break;

            case ECOpCodes.EC_OP_SHARED_FILES:
                m_owner.SharedFilesReply(packet);
                break;

            case ECOpCodes.EC_OP_NOOP:
                break;

            default:
                throw new Exception("Unhandled EC reply");
            }
        }
예제 #2
0
 public ecPacket(ECOpCodes cmd, EC_DETAIL_LEVEL detail_level)
 {
     m_flags  = 0x20;
     m_opcode = cmd;
     if (detail_level != EC_DETAIL_LEVEL.EC_DETAIL_FULL)
     {
         AddSubtag(new ecTagInt(ECTagNames.EC_TAG_DETAIL_LEVEL, (Int64)detail_level));
     }
 }
예제 #3
0
            public ecPacket(BinaryReader br)
            {
                m_flags = System.Net.IPAddress.NetworkToHostOrder(br.ReadInt32());
                Int32 packet_size = System.Net.IPAddress.NetworkToHostOrder(br.ReadInt32());

                m_opcode = (ECOpCodes)br.ReadByte();

                Int16 tags_count = System.Net.IPAddress.NetworkToHostOrder(br.ReadInt16());

                if (tags_count != 0)
                {
                    for (int i = 0; i < tags_count; i++)
                    {
                        ecTag t = ReadTag(br);
                        AddSubtag(t);
                    }
                }
            }
예제 #4
0
 public amuleGenericContainer(ECOpCodes req_cmd, ECTagNames item_tagname, IContainerUI owner)
 {
     m_owner        = owner;
     m_req_cmd      = req_cmd;
     m_item_tagname = item_tagname;
 }
예제 #5
0
 //
 // Default ctor - for tx packets
 public ecPacket(ECOpCodes cmd)
 {
     m_flags  = 0x20;
     m_opcode = cmd;
 }