Ejemplo n.º 1
0
        private void OVSopenBtn_Click(object sender, EventArgs e)
        {
            openFileDialog.FileName = "select Planet Coaster OVS file";
            openFileDialog.Filter   = "Planet Coaster OVS Files|*.ovs";

            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (openFileDialog.FileName.Contains(".ovs"))
                {
                    OZlib zlib = new OZlib(openFileDialog.FileName);
                    MessageBox.Show("The file has been Successfully unpacked");
                }
                else
                {
                    MessageBox.Show("This is not a Planet Coaster OVS file");
                }
            }
        }
Ejemplo n.º 2
0
        public OVL(string fullPath)
        {
            try
            {
                reader = new BinaryReader(File.OpenRead(fullPath));
            }
            catch
            {
                MessageBox.Show("Unable to open or read the specified file!");
            }
            finally
            {
                header = new OHeader(reader);
                validateHeader();
                header.save(fullPath);

                int headerID = header.headerID;

                st = new OStringTable(reader, (int)(header.stringTableSize));
                st.stringTableSave(headerID, header.fileName);
                stringTable = st.str;

                for (int i = 0; i < header.dirCount; i++)
                {
                    dir = new ODirectory(reader, stringTable);
                    dir.dirSave(headerID, header.fileName);
                }

                for (int j = 0; j < header.fileCount; j++)
                {
                    f = new OFile(reader, stringTable);
                    f.fileSave(headerID, header.fileName);
                }

                char[] chars = reader.ReadChars((int)header.archStringSize);
                archiveString = "";
                for (int k = 0; k < (int)header.archStringSize; k++)
                {
                    archiveString += chars[k];
                }

                for (int l = 0; l < (int)header.archiveCount; l++)
                {
                    arch = new OArchive(reader, archiveString);
                    arch.archSave(headerID, header.fileName);
                    if (l == 0)
                    {
                        compressedSize = (int)arch.compressedSize;
                    }
                }

                for (int m = 0; m < header.partCount; m++)
                {
                    part = new OPart(reader, stringTable);
                    part.partSave(headerID, header.fileName);
                }

                for (int n = 0; n < header.unknownCount; n++)
                {
                    unknown = new OUnknown(reader);
                    unknown.unknownSave(headerID, header.fileName);
                }

                for (int p = 0; p < header.archiveCount; p++)
                {
                    arch2 = new OArchive2(reader);
                    arch2.archive2Save(headerID, header.fileName);
                }

                compressedData = reader.ReadBytes(compressedSize);
                zlib           = new OZlib(fullPath, compressedData);

                reader.Dispose();
            }
        }