Exemple #1
0
        private static BlobFrag readFragment(BinaryReader packetReader)
        {
            BlobFrag newFrag = new BlobFrag();

            newFrag.memberHeader_ = BlobFragHeader_t.read(packetReader);
            newFrag.dat_          = packetReader.ReadBytes(newFrag.memberHeader_.blobFragSize - 16); // 16 == size of frag header

            return(newFrag);
        }
        private void readPacket(PacketRecord packet, StringBuilder packetTypeStr, BinaryReader packetReader)
        {
            BlobFrag newFrag = new BlobFrag();

            newFrag.memberHeader_ = BlobFragHeader_t.read(packetReader);
            newFrag.dat_          = packetReader.ReadBytes(newFrag.memberHeader_.blobFragSize - 16); // 16 == size of frag header

            packet.netPacket.fragList_.Add(newFrag);

            BinaryReader fragDataReader = new BinaryReader(new MemoryStream(newFrag.dat_));

            if (newFrag.memberHeader_.blobNum != 0)
            {
                packetTypeStr.Append("FragData[");
                packetTypeStr.Append(newFrag.memberHeader_.blobNum);
                packetTypeStr.Append("]");
            }
            else
            {
                PacketOpcode opcode = Util.readOpcode(fragDataReader);
                packet.opcodes.Add(opcode);
                packetTypeStr.Append(opcode.ToString());
            }
        }