Exemplo n.º 1
0
        private void ThreadLoadPatcherConfiguration()
        {
            try
            {
                DebugLogger.Log("Loading patcher configuration...");

                _state.Value = PatcherState.LoadingPatcherConfiguration;

                // TODO: Use PatcherConfigurationReader
                _configuration = DefaultConfiguration;

                DebugLogger.Log("Patcher configuration loaded.");
            }
            catch (ThreadInterruptedException)
            {
                DebugLogger.Log("Loading patcher configuration interrupted: thread has been interrupted. Rethrowing exception.");
                throw;
            }
            catch (ThreadAbortException)
            {
                DebugLogger.Log("Loading patcher configuration aborted: thread has been aborted. Rethrowing exception.");
                throw;
            }
            catch (Exception)
            {
                DebugLogger.LogError("Error while loading patcher configuration: an exception has occured. Rethrowing exception.");
                throw;
            }
        }
Exemplo n.º 2
0
        public bool Execute()
        {
            Log.Debug("Initializing");

            GetXCOMRootDirectory();

            PatcherConfig = PatcherConfiguration.LoadConfiguration(ConfigurationFile);
            ExpandPatchTargetPaths();

            ApplyPatches();

            //BackupExecutable();
            //ApplyPatches();
            //Patcher.SaveChanges();
            return(true);
        }
Exemplo n.º 3
0
        private static void TestSerialization()
        {
            var config = new PatcherConfiguration()
            {
                BackupDirectory = @"XEW\Backup",
                DecompressedUPKOutputDirectory = @"XEW\UpkUnpacked"
            };

            config.Targets.Add(new PatchTarget()
            {
                TargetPath   = @"XEW\Binaries\Win32\XComEW.exe",
                IsUPKFile    = false,
                PatchEntries =
                {
                    new PatchEntry()
                    {
                        Description = "Read DefaultGameCore.ini from Config Folder",
                        FindValue   =
                            "   25 00 64 00 00 00 00 00 49 00 6e 00 69 00 56 00 65 00 72 00 73 00 69 00 6f 00 6e 00 00 00 00 00 2e 00 2e 00 5c 00 2e 00 2e 00 5c 00 58 00 43 00 ",
                        ReplaceValue =
                            "   25 00 64 00 00 00 00 00 49 00 6e 00 69 00 56 00 65 00 72 00 73 00 69 00 6f 00 6e 00 00 00 00 00 2e 00 2e 00 5c 00 2e 00 2e 00 5c 00 57 00 43 00 "
                    }
                }
            });

            config.Targets.Add(new PatchTarget()
            {
                IsUPKFile    = true,
                TargetPath   = @"XEW\XComGame\CookedPCConsole\XComGame.upk",
                PatchEntries =
                {
                    new PatchEntry()
                    {
                        Description  = "Changes Gender Chance from 1/2 chance of female, to 1/8 chance of female",
                        FindValue    = "45 9A A7 2C 02 16",
                        ReplaceValue = "45 9A A7 2C 08 16"
                    }
                }
            });

            PatcherConfiguration.WriteConfiguration(config, "test_config.xml");
        }
Exemplo n.º 4
0
 private void DoInitialize()
 {
     Config.Init(ConfigurationManager.AppSettings);
     PatcherConfiguration.Init(ConfigurationManager.AppSettings);
 }