Beispiel #1
0
        public AssemblyDefinition Execute(
            AssemblyDefinition assemblyDefinition,
            ILogger logger,
            string patcherWorkingPath,
            IPaths gamePaths)
        {
            try
            {
                logger_      = logger;
                workingPath_ = patcherWorkingPath;

                //GameState.GameStateUtil.logger = logger;
                //var enabled = GameState.GameStateUtil.IsModEnabled(workingPath_);
                //logger.Info("is enabled:" + enabled?.ToString() ?? "null");

                assemblyDefinition = ImproveLoggingPatch(assemblyDefinition);
                assemblyDefinition = BindEnableDisableAllPatch(assemblyDefinition);
                //assemblyDefinition = NewsFeedPanelPatch(assemblyDefinition); // handled by harmony patch
                InstallResolverLog();
                if (ConfigUtil.Config.AddHarmonyResolver)
                {
                    InstallHarmonyResolver();
                }

                assemblyDefinition = SubscriptionManagerPatch(assemblyDefinition); // must be called to check if patch loader is effective.

                if (ConfigUtil.Config.TurnOffSteamPanels)
                {
                    NoQueryPatch(assemblyDefinition); // handled by harmony patch
                }
            } catch (Exception ex) { logger.Error(ex.ToString()); }
            return(assemblyDefinition);
        }
Beispiel #2
0
 public AssemblyDefinition Execute(
     AssemblyDefinition assemblyDefinition,
     ILogger logger,
     string patcherWorkingPath,
     IPaths gamePaths)
 {
     logger_            = logger;
     workingPath_       = patcherWorkingPath;
     assemblyDefinition = LogFormatPatch(assemblyDefinition);
     return(assemblyDefinition);
 }
Beispiel #3
0
        public AssemblyDefinition Execute(
            AssemblyDefinition assemblyDefinition,
            ILogger logger,
            string patcherWorkingPath,
            IPaths gamePaths)
        {
            logger_      = logger;
            workingPath_ = patcherWorkingPath;

            bool noReporters = Environment.GetCommandLineArgs().Any(_arg => _arg == "-cold-reload");

            if (noReporters)
            {
                NoReportersPatch(assemblyDefinition);
            }

            if (!poke && Config.SoftDLLDependancy)
            {
                FindAssemblySoftPatch(assemblyDefinition);
            }

            // TODO uncomment after understanding how CS prevents double loading during hot reload
            // NoDoubleLoadPatch(assemblyDefinition);

            assemblyDefinition = LoadAssembliesPatch(assemblyDefinition);
            //assemblyDefinition = LoadPluginsPatch(assemblyDefinition); // its loaded in ASCPatch.LoadDLL() instead
            AddAssemlyPatch(assemblyDefinition);
            assemblyDefinition = AddPluginsPatch(assemblyDefinition);
#if DEBUG
            //assemblyDefinition = InsertPrintStackTrace(assemblyDefinition);
#endif

            EnsureIncludedExcludedPackagePatch(assemblyDefinition);

            bool noAssets = Environment.GetCommandLineArgs().Any(_arg => _arg == "-noAssets");
            if (noAssets)
            {
                assemblyDefinition = NoCustomAssetsPatch(assemblyDefinition);
            }
            else
            {
                ExcludeAssetFilePatch(assemblyDefinition);
                ExcludeAssetDirPatch(assemblyDefinition);
            }

            LoadPluginPatch(assemblyDefinition);

            return(assemblyDefinition);
        }