示例#1
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (!File.Exists(cfg.ao_dir + "\\cd_image\\data\\db\\ResourceDatabase.idx"))
            {
                MessageBox.Show("Path to Anarchy Online is wrong, please check your preferences.");
                return;
            }

            Extractor extractor = new Extractor(cfg.ao_dir + "\\cd_image\\data\\db\\");

            progressBar1.Step = 1;
            panel2.Visible    = true;
            panel2.Update();

            foreach (int recType in extractor.GetRecordTypes())
            {
                if ((recType == 1000026) || (recType == 1000020))
                {
                    progressBar1.Maximum = extractor.GetRecordInstances(recType).Length;
                    progressBar1.Value   = 0;
                    foreach (int recInstance in extractor.GetRecordInstances(recType))
                    {
                        byte[] temp = extractor.GetRecordData(recType, recInstance);
                        if (!Directory.Exists(cfg.item_dir + "\\" + recType))
                        {
                            Directory.CreateDirectory(cfg.item_dir + "\\" + recType);
                        }
                        FileStream fs =
                            new FileStream(
                                cfg.item_dir + "\\" + recType.ToString() + "\\" + recInstance.ToString() + ".rdbdata",
                                FileMode.Create,
                                FileAccess.Write);
                        fs.Write(temp, 0, temp.Length);
                        fs.Close();
                        progressBar1.PerformStep();
                    }
                }
            }
            panel2.Visible = false;
        }
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (!File.Exists(cfg.ao_dir + "\\cd_image\\data\\db\\ResourceDatabase.idx"))
            {
                MessageBox.Show("Path to Anarchy Online is wrong, please check your preferences.");
                return;
            }

            Extractor extractor = new Extractor(cfg.ao_dir + "\\cd_image\\data\\db\\");

            progressBar1.Step = 1;
            panel2.Visible = true;
            panel2.Update();

            foreach (int recType in extractor.GetRecordTypes())
            {
                if ((recType == 1000026) || (recType==1000020))
                {
                    progressBar1.Maximum = extractor.GetRecordInstances(recType).Length;
                    progressBar1.Value = 0;
                    foreach (int recInstance in extractor.GetRecordInstances(recType))
                    {
                        byte[] temp = extractor.GetRecordData(recType, recInstance);
                        if (!Directory.Exists(cfg.item_dir + "\\" + recType))
                        {
                            Directory.CreateDirectory(cfg.item_dir + "\\" + recType);
                        }
                        FileStream fs =
                            new FileStream(
                                cfg.item_dir + "\\" + recType.ToString() + "\\" + recInstance.ToString() + ".rdbdata",
                                FileMode.Create,
                                FileAccess.Write);
                        fs.Write(temp, 0, temp.Length);
                        fs.Close();
                        progressBar1.PerformStep();
                    }
                }
            }
            panel2.Visible = false;
        }