예제 #1
0
        public byte[] Extract(UOPFileIndexDef id)
        {
            for (int i = 0; i < m_ListData.Count; i++)
            {
                if (m_ListData[i].First.Equals(id))
                {
                    return(m_ListData[i].Second.Extract(m_ListData[i].First.IsCompressed, m_ListData[i].First.m_LenghtUncompressed));
                }
            }

            return(null);
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            if (!obj.GetType().Equals(this.GetType()))
            {
                return(false);
            }

            UOPFileIndexDef objCurrent = (UOPFileIndexDef)obj;

            return((m_OffsetOfDataBlock == objCurrent.m_OffsetOfDataBlock) && (m_SizeofDataHeaders == objCurrent.m_SizeofDataHeaders) &&
                   (m_LenghtCompressed == objCurrent.m_LenghtCompressed) && (m_LenghtUncompressed == objCurrent.m_LenghtUncompressed) &&
                   (m_Unknown1 == objCurrent.m_Unknown1) && (m_Unknown2 == objCurrent.m_Unknown2) && (m_Unknown3 == objCurrent.m_Unknown3) &&
                   (m_CompressedFlag == objCurrent.m_CompressedFlag));
        }
예제 #3
0
        public static UOPFileIndexDef FromBinary(System.IO.BinaryReader bStream)
        {
            UOPFileIndexDef toReturn = new UOPFileIndexDef();

            toReturn.m_OffsetOfDataBlock  = bStream.ReadUInt64();
            toReturn.m_SizeofDataHeaders  = bStream.ReadUInt32();
            toReturn.m_LenghtCompressed   = bStream.ReadUInt32();
            toReturn.m_LenghtUncompressed = bStream.ReadUInt32();
            toReturn.m_Unknown1           = bStream.ReadUInt32();
            toReturn.m_Unknown2           = bStream.ReadUInt32();
            toReturn.m_Unknown3           = bStream.ReadUInt32();
            toReturn.m_CompressedFlag     = bStream.ReadUInt16();

            return(toReturn);
        }
예제 #4
0
        public static UOPIndexBlockHeader FromBinary(System.IO.BinaryReader bStream)
        {
            UOPIndexBlockHeader toReturn = new UOPIndexBlockHeader();

            toReturn.m_Files           = bStream.ReadUInt32();
            toReturn.m_OffsetNextIndex = bStream.ReadUInt64();

            for (uint iData = 0; iData < toReturn.m_Files; iData++)
            {
                UOPFileIndexDef uopIndextemp = UOPFileIndexDef.FromBinary(bStream);

                long oldPos = bStream.BaseStream.Position;
                bStream.BaseStream.Seek((long)(uopIndextemp.m_OffsetOfDataBlock), System.IO.SeekOrigin.Begin);

                UOPFileData uopDatatemp = UOPFileData.FromBinary(bStream, uopIndextemp.m_LenghtCompressed);

                toReturn.m_ListData.Add(new UOPPairData(uopIndextemp, uopDatatemp));
                bStream.BaseStream.Seek(oldPos, System.IO.SeekOrigin.Begin);
            }

            return(toReturn);
        }
예제 #5
0
        public static UOPFileIndexDef FromBinary(System.IO.BinaryReader bStream)
        {
            UOPFileIndexDef toReturn = new UOPFileIndexDef();

            toReturn.m_OffsetOfDataBlock = bStream.ReadUInt64();
            toReturn.m_SizeofDataHeaders = bStream.ReadUInt32();
            toReturn.m_LenghtCompressed = bStream.ReadUInt32();
            toReturn.m_LenghtUncompressed = bStream.ReadUInt32();
            toReturn.m_Unknown1 = bStream.ReadUInt32();
            toReturn.m_Unknown2 = bStream.ReadUInt32();
            toReturn.m_Unknown3 = bStream.ReadUInt32();
            toReturn.m_CompressedFlag = bStream.ReadUInt16();

            return toReturn;
        }
예제 #6
0
 public UOPPairData(UOPFileIndexDef object1, UOPFileData object2)
 {
     m_FirstData = object1;
     m_SecondData = object2;
 }
예제 #7
0
        public byte[] Extract(UOPFileIndexDef id)
        {
            for (int i = 0; i < m_ListData.Count; i++)
                if (m_ListData[i].First.Equals(id))
                    return m_ListData[i].Second.Extract(m_ListData[i].First.IsCompressed, m_ListData[i].First.m_LenghtUncompressed);

            return null;
        }
예제 #8
0
 public UOPPairData(UOPFileIndexDef object1, UOPFileData object2)
 {
     m_FirstData  = object1;
     m_SecondData = object2;
 }