예제 #1
0
        static void Main(string[] args)
        {
            bool           debug   = false;
            XClientManager manager = new XClientManager();

            Console.WriteLine("Would you like to debug? Y/N");
            debug = Console.ReadKey(false).Key == ConsoleKey.Y ? true : false;
            if (debug)
            {
                Console.WriteLine("Debugging...");
            }
            Console.WriteLine("Reading old data.000...");
            manager.Open("F:\\Games\\DarknessFight\\data.000");

            foreach (CSDATA_INDEX indexew in manager.m_lClient.ToList())
            {
                if (manager.Patch("F:\\Games\\DarknessFight", indexew) == -1 && debug)
                {
                    Console.WriteLine("Filtered: {0}", indexew.szName);
                }
            }
            Console.WriteLine("Writing data.000...");
            for (int i = 1; i < 9; i++)
            {
                System.IO.File.Move(manager.tempDataName[i], "F:\\Games\\DarknessFight\\new\\data.00" + i);
            }
            manager.Save("F:\\Games\\DarknessFight\\new\\data.000");
            Console.WriteLine("Done!");
            Console.ReadKey();
        }
예제 #2
0
        private void RunCleaner()
        {
            int            currentFile = 0;
            XClientManager manager     = new XClientManager();

            try
            {
                manager.Open(Path.Combine(runPath, "data.000"));
                int maxFile = manager.m_lClient.Count;
                pbPatcher.Invoke((MethodInvoker)(() => pbPatcher.Maximum = maxFile + 6));
                pbPatcher.Invoke((MethodInvoker)(() => pbPatcher.Step = 1));
                pbPatcher.Invoke((MethodInvoker)(() => pbPatcher.Minimum = 0));
                pbPatcher.Invoke((MethodInvoker)(() => pbPatcher.Value = 0));
                pbPatcher.Invoke((MethodInvoker)(() => pbPatcher.Style = ProgressBarStyle.Blocks));

                foreach (CSDATA_INDEX index in manager.m_lClient.ToList())
                {
                    manager.Patch(runPath, index);
                    updateProgressBar(ref currentFile);
                }

                for (int i = 1; i < 9; i++)
                {
                    string dataFile = Path.Combine(runPath, "data.00" + i);
                    if (File.Exists(dataFile))
                    {
                        File.Delete(dataFile);
                    }
                    File.Move(manager.tempDataName[i], dataFile);
                    updateProgressBar(ref currentFile);
                }
                if (File.Exists(Path.Combine(runPath, "data.000")))
                {
                    File.Delete(Path.Combine(runPath, "data.000"));
                }
                manager.Save(Path.Combine(runPath, "data.000"));

                if (MessageBox.Show("Successfully cleaned your client!", "Done!", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
                {
                    formMain.ActiveForm.Invoke((MethodInvoker)(() => formMain.ActiveForm.Dispose()));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }