示例#1
0
        public static Task <bool> PatchCharLevels(ZipArchive archive, string change, IProgress <string> log, XmlDocument patchInfo)
        {
            return(Task.Factory.StartNew(() =>
            {
                log.Report("Patche Erfahrungspunkte..");

                ZipArchiveEntry entry = archive.GetEntry(ArchiveEntries.CharLevels);
                if (entry != null)
                {
                    string charLevels = entry.ReadString();
                    if (charLevels != change)
                    {
                        log.Report($"Schreibe Level..");

                        entry.SetString(change);
                        AppendPatchChangeText(patchInfo, "CharLevels", "Content", change);
                    }
                    else
                    {
                        log.Report("Keine Änderungen gefunden");
                    }
                }
                else
                {
                    log.Report($"Element {ArchiveEntries.CharLevels} nicht gefunden");
                }

                return true;
            }));
        }