ACR_ServerCommunicator.ACR_ServerCommunicator.PatchContentFiles C# (CSharp) Method

PatchContentFiles() private method

Apply content patches as appropriate.
private PatchContentFiles ( ) : void
return void
        private void PatchContentFiles()
        {
            ALFA.Database Database = GetDatabase();
            uint Module = GetModule();
            string ContentPatchPath = GetLocalString(Module, "ACR_MOD_CONTENT_PATCH_PATH");

            WriteTimestampedLogEntry("ACR_ServerCommunicator.PatchContentFiles: Checking for content patch updates (hotfixes)...");

            //
            // If the content patch path wasn't configured, then the feature is
            // not enabled.
            //

            if (String.IsNullOrEmpty(ContentPatchPath))
            {
                WriteTimestampedLogEntry("ACR_ServerCommunicator.PatchContentFiles: ContentPatchPath variable is not defined in the config table in the database, skipping content patch evaluation.");
                return;
            }

            DeleteLocalString(Module, "ACR_MOD_CONTENT_PATCH_PATH");

            //
            // Check for and apply any content patches that are applicable to
            // the current hak version.  If a reboot is required, then signal a
            // restart event using the IPC subsystem (so that we receive the
            // benefit of the shutdown watchdog).
            //

            try
            {
                if (ModuleContentPatcher.ProcessContentPatches(ContentPatchPath, Database, this, WorldManager.Configuration.UpdaterConnectionString))
                {
                    int ServerId = Database.ACR_GetServerID();

                    SignalIPCEvent(0,
                        ServerId,
                        0,
                        ServerId,
                        GameWorldManager.ACR_SERVER_IPC_EVENT_SHUTDOWN_SERVER,
                        "A server restart is required in order to apply a content hotfix.  The server will restart shortly.");
                }
                else
                {
                    WriteTimestampedLogEntry("ACR_ServerCommunicator.PatchContentFiles: No content patches were applicable, continuing with server startup.");
                }
            }
            catch (Exception e)
            {
                WriteTimestampedLogEntry(String.Format(
                    "ACR_ServerCommunicator.PatchContentFiles: Exception {0} processing content file patches.",
                    e));
            }
        }
ACR_ServerCommunicator