Table of Contents

Class ContentManifestCache

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

What a jar says about itself, remembered for as long as the jar has not changed.

public sealed class ContentManifestCache
Inheritance
ContentManifestCache
Inherited Members

Remarks

Reading a manifest means opening the jar and every jar bundled inside it — fabric-api alone is forty-odd — and finding the other copies of a mod reads the whole folder. "Update all" does that once per mod, so a folder of thirty mods was nine hundred jar reads for one click, all of them producing the same answers.

Keyed like FileHashCache, by path plus size plus write time, for the same reason: replace or re-download a jar and the stamp moves, so the cached answer is never served for a file that is no longer the one it was read from.

Methods

ForgetAllBut(IEnumerable<string>)

Drops every jar but present: the ones renamed or deleted since.

public void ForgetAllBut(IEnumerable<string> present)

Parameters

present IEnumerable<string>

Remarks

Every toggle renames a jar and every update writes a new one, so without this the cache only grew for as long as the app ran.

Read(string)

The jar's manifest, reading it only if this exact file has not been read already.

public ContentManifest.Manifest Read(string path)

Parameters

path string

Returns

ContentManifest.Manifest