Ejemplo n.º 1
0
        public unsafe static int GetAssetBundleIndex(string asset, out int bedependedTag)
        {
            uint asset_crc = Verifier.GetCrc32Unit(asset);
            int  index     = -1;

            if (crcIndexer.TryGetValue(asset_crc, out index))
            {
                BaseAssetInfo assetinfo = p_assetinfo[index];
                bedependedTag = assetinfo.asset_beDependedTag;
                return(assetinfo.ab_index);
            }
            if (conflic_asset_abindex == null)
            {
                conflic_asset_abindex = new Dictionary <string, ConflicBaseAssetInfo>();
                Position = conflic_Blob;
                int conflic_count = read_int();
                for (int i = 0; i < conflic_count; i++)
                {
                    ConflicBaseAssetInfo conflicBaseAssetInfo = new ConflicBaseAssetInfo();
                    conflicBaseAssetInfo.ab_index         = read_int();
                    conflicBaseAssetInfo.asset_beDepended = read_int();
                    conflicBaseAssetInfo.asset_name       = read_str();
                    conflic_asset_abindex.Add(conflicBaseAssetInfo.asset_name, conflicBaseAssetInfo);
                }
            }
            ConflicBaseAssetInfo conflicInfo;

            if (!conflic_asset_abindex.TryGetValue(asset, out conflicInfo))
            {
                bedependedTag = 0;
                return(-1);
            }
            bedependedTag = conflicInfo.asset_beDepended;
            return(conflicInfo.ab_index);
        }
Ejemplo n.º 2
0
        public unsafe static void Setup(byte[] bytes)
        {
            fileLength = bytes.Length;
            IntPtr p = Marshal.AllocHGlobal(bytes.Length);

            Marshal.Copy(bytes, 0, p, bytes.Length);
            m_pData                    = (byte *)(void *)p;
            m_Position                 = 0;
            PackageListHeader          = read_chars(3);
            PackageListVersion         = read_byte();
            encryptBytes               = read_bytes(4);
            applicableGameVersionBytes = read_bytes(read_byte());
            InternalResourceVersion    = read_int();
            AssetCount                 = read_int();
            AssetBundleCount           = read_int();
            assert_Blob                = read_int();
            arr_Blob                   = read_int();
            ab_Blob                    = read_int();
            conflic_Blob               = read_int();
            p_assetinfo                = (BaseAssetInfo *)(m_pData + assert_Blob);
            crcIndexer                 = new Dictionary <uint, int>(AssetCount);
            List <uint> conflic_asset = new List <uint>();

            for (int i = 0; i < AssetCount; i++)
            {
                BaseAssetInfo info = p_assetinfo[i];
                if (crcIndexer.ContainsKey(info.asset_crc))
                {
                    if (!conflic_asset.Contains(info.asset_crc))
                    {
                        conflic_asset.Add(info.asset_crc);
                    }
                }
                else
                {
                    crcIndexer.Add(info.asset_crc, i);
                }
            }
            foreach (uint crc in conflic_asset)
            {
                crcIndexer.Remove(crc);
            }
            p_bundleinfo = (BaseBundleInfo *)(m_pData + ab_Blob);
            if (conflic_asset_abindex != null)
            {
                conflic_asset_abindex.Clear();
                conflic_asset_abindex = null;
            }
        }
Ejemplo n.º 3
0
        public unsafe static List <uint> GetAll_AB_crc()
        {
            var list = new List <uint>();

            foreach (var item in crcIndexer)
            {
                var crc   = item.Key;
                var index = item.Value;

                BaseAssetInfo  assetInfo  = p_assetinfo[index];
                BaseBundleInfo bundleInfo = p_bundleinfo[assetInfo.ab_index];
                ///bedependedTag = assetinfo.asset_beDependedTag;
                list.Add(bundleInfo.ab_crc);
            }
            return(list);
        }