Beispiel #1
0
        private static void LoadWebFile(string fullName, EndianBinaryReader reader)
        {
            var fileName = Path.GetFileName(fullName);

            StatusStripUpdate("Loading " + fileName);
            var webFile = new WebFile(reader);

            reader.Dispose();
            foreach (var file in webFile.fileList)
            {
                var dummyName = Path.GetDirectoryName(fullName) + "\\" + file.fileName;
                switch (CheckFileType(file.stream, out reader))
                {
                case FileType.AssetsFile:
                    LoadAssetsFile(dummyName, reader, fullName);
                    break;

                case FileType.BundleFile:
                    LoadBundleFile(dummyName, reader, fullName);
                    break;

                case FileType.WebFile:
                    LoadWebFile(dummyName, reader);
                    break;
                }
                resourceFileReaders.Add(file.fileName.ToUpper(), reader);
            }
        }
Beispiel #2
0
        private void LoadWebFile(string fullName, EndianBinaryReader reader)
        {
            var fileName = Path.GetFileName(fullName);

            Logger.Info("Loading " + fileName);
            var webFile = new WebFile(reader);

            reader.Dispose();
            foreach (var file in webFile.fileList)
            {
                var dummyPath = Path.GetDirectoryName(fullName) + "\\" + file.fileName;
                switch (CheckFileType(file.stream, out reader))
                {
                case FileType.AssetsFile:
                    LoadAssetsFromMemory(dummyPath, reader, fullName);
                    break;

                case FileType.BundleFile:
                    LoadBundleFile(dummyPath, reader, fullName);
                    break;

                case FileType.WebFile:
                    LoadWebFile(dummyPath, reader);
                    break;
                }
            }
        }
Beispiel #3
0
        private static int ExtractWebDataFile(string webFileName, EndianBinaryReader reader)
        {
            StatusStripUpdate($"Decompressing {Path.GetFileName(webFileName)} ...");
            var webFile = new WebFile(reader);

            reader.Dispose();
            if (webFile.fileList.Count > 0)
            {
                var extractPath = webFileName + "_unpacked\\";
                Directory.CreateDirectory(extractPath);
                return(ExtractStreamFile(extractPath, webFile.fileList));
            }
            return(0);
        }
Beispiel #4
0
        private void LoadWebFile(string fullName, EndianBinaryReader reader)
        {
            var fileName = Path.GetFileName(fullName);

            Logger.Info("Loading " + fileName);
            try
            {
                var webFile = new WebFile(reader);
                foreach (var file in webFile.fileList)
                {
                    var dummyPath = Path.GetDirectoryName(fullName) + "\\" + file.fileName;
                    switch (CheckFileType(file.stream, out var fileReader))
                    {
                    case FileType.AssetsFile:
                        LoadAssetsFromMemory(dummyPath, fileReader, fullName);
                        break;

                    case FileType.BundleFile:
                        LoadBundleFile(dummyPath, fileReader, fullName);
                        break;

                    case FileType.WebFile:
                        LoadWebFile(dummyPath, fileReader);
                        break;

                    case FileType.ResourceFile:
                        resourceFileReaders.Add(file.fileName, fileReader);
                        break;
                    }
                }
            }
            catch
            {
                //Logger.Error($"Unable to load web file {fileName}");
            }
            finally
            {
                reader.Dispose();
            }
        }
Beispiel #5
0
        private void LoadWebFile(string fullName, EndianBinaryReader reader)
        {
            var fileName = Path.GetFileName(fullName);

            Logger.Info("Loading " + fileName);
            try
            {
                var webFile = new WebFile(reader);
                foreach (var file in webFile.fileList)
                {
                    var dummyPath = Path.Combine(Path.GetDirectoryName(fullName), file.fileName);
                    switch (CheckFileType(file.stream, out var fileReader))
                    {
                    case FileType.AssetsFile:
                        LoadAssetsFromMemory(dummyPath, fileReader, fullName);
                        break;

                    case FileType.BundleFile:
                        LoadBundleFile(dummyPath, fileReader, fullName);
                        break;

                    case FileType.WebFile:
                        LoadWebFile(dummyPath, fileReader);
                        break;

                    case FileType.ResourceFile:
                        resourceFileReaders[file.fileName] = fileReader;     //TODO
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                Logger.Error($"Error while reading web file {fileName}", e);
            }
            finally
            {
                reader.Dispose();
            }
        }
Beispiel #6
0
        private void LoadWebFile(FileReader reader)
        {
            Logger.Info("Loading " + reader.FileName);
            try
            {
                var webFile = new WebFile(reader);
                foreach (var file in webFile.fileList)
                {
                    var dummyPath = Path.Combine(Path.GetDirectoryName(reader.FullPath), file.fileName);
                    var subReader = new FileReader(dummyPath, file.stream);
                    switch (subReader.FileType)
                    {
                    case FileType.AssetsFile:
                        LoadAssetsFromMemory(subReader, reader.FullPath);
                        break;

                    case FileType.BundleFile:
                        LoadBundleFile(subReader, reader.FullPath);
                        break;

                    case FileType.WebFile:
                        LoadWebFile(subReader);
                        break;

                    case FileType.ResourceFile:
                        resourceFileReaders[file.fileName] = subReader;     //TODO
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                Logger.Error($"Error while reading web file {reader.FileName}", e);
            }
            finally
            {
                reader.Dispose();
            }
        }