Beispiel #1
0
        private static IPacket Assembler_PACKET_TEST_PACKET_2(ByteArray buffer)
        {
            PACKET_TEST_PACKET_2 packet = new PACKET_TEST_PACKET_2();

            packet.Read(buffer);
            return(packet);
        }
        public void Read(ByteArray buffer)
        {
            attrib1 = buffer.ReadByte();
            attrib2 = buffer.ReadShort();
            attrib3 = buffer.ReadInt();
            attrib4 = buffer.ReadFloat();
            attrib6 = buffer.ReadString();
            attrib7 = buffer.ReadInt64();
            attrib8 = buffer.ReadBool();
            pack    = new PACKET_TEST_PACKET_2();
            pack.Read(buffer);
            packs.Clear();
            short packsLen = buffer.ReadShort();

            for (int i = 0; i < packsLen; ++i)
            {
                PACKET_TEST_PACKET_2 packsItem = new PACKET_TEST_PACKET_2();
                packsItem.Read(buffer);
                packs.Add(packsItem);
            }
            intlist.Clear();
            short intlistLen = buffer.ReadShort();

            for (int i = 0; i < intlistLen; ++i)
            {
                intlist.Add(buffer.ReadInt());
            }
            floatList.Clear();
            short floatListLen = buffer.ReadShort();

            for (int i = 0; i < floatListLen; ++i)
            {
                floatList.Add(buffer.ReadFloat());
            }
            shortList.Clear();
            short shortListLen = buffer.ReadShort();

            for (int i = 0; i < shortListLen; ++i)
            {
                shortList.Add(buffer.ReadShort());
            }
            strList.Clear();
            short strListLen = buffer.ReadShort();

            for (int i = 0; i < strListLen; ++i)
            {
                strList.Add(buffer.ReadString());
            }
        }