Пример #1
0
        protected MPQPatchChain(int requiredVersion, IEnumerable <string> baseFiles, string patchPattern = null)
        {
            this.Loaded          = false;
            this.RequiredVersion = requiredVersion;

            foreach (var file in baseFiles)
            {
                var mpqFile = MPQStorage.GetMPQFile(file);
                if (mpqFile == null)
                {
                    Logger.Error("Cannot find base MPQ file: {0}.", file);
                    return;
                }
                this.BaseMPQFiles.Add(mpqFile);
                Logger.Trace("Added base-mpq file: {0}.", file);
            }

            this.PatchPattern = patchPattern;
            this.ConstructChain();

            var topMostMPQVersion = this.MPQFileList.Reverse().First().Key; // check required version.

            if (topMostMPQVersion == this.RequiredVersion)
            {
                this.Loaded = true;
            }
            else
            {
                Logger.Error("Required patch-chain version {0} is not satified (found version: {1}).", this.RequiredVersion, topMostMPQVersion);
            }
        }
Пример #2
0
        protected MPQPatchChain(IEnumerable <string> baseFiles, string patchPattern = null)
        {
            this.Loaded = false;

            foreach (var file in baseFiles)
            {
                var mpqFile = MPQStorage.GetMPQFile(file);
                if (mpqFile == null)
                {
                    Logger.Error("Cannot find base MPQ file: {0}.", file);
                    return;
                }
                this.BaseMPQFiles.Add(mpqFile);
                Logger.Trace("Added base-mpq file: {0}.", file);
            }

            this.PatchPattern = patchPattern;
            this.ConstructChain();

            var topMostMPQVersion = this.MPQFileList.Reverse().First().Key; // check required version.

            this.Loaded = true;
        }