Table of Contents

Class ContentDependencyCheck

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

Whether every installed mod and plugin has what it needs, answered from the jars alone.

public static class ContentDependencyCheck
Inheritance
ContentDependencyCheck
Inherited Members

Remarks

This runs before every start, so it has to be fast and it has to be right when offline. Both follow from asking the jars instead of the store: opening N zip files takes milliseconds, needs no network, and cannot be wrong because a store page forgot to list a dependency — which is not hypothetical, it is the exact shape of the crash this was written for.

Satisfied means "something installed provides that name", not "some version range is met". Ranges are deliberately not checked: the declared ranges are frequently wrong in both directions, and a start blocked by a range nobody can verify would be a check people learn to click through. A name that is simply not there is unambiguous, and it is what the loader itself refuses to start over.

Methods

Check(IEnumerable<Manifest>)

What a folder full of jars is missing. Empty when everything is satisfied.

public static IReadOnlyList<ContentDependencyCheck.Missing> Check(IEnumerable<ContentManifest.Manifest> installed)

Parameters

installed IEnumerable<ContentManifest.Manifest>

Returns

IReadOnlyList<ContentDependencyCheck.Missing>

CheckServer(ServerConfig)

What a server's content folder is missing.

public static IReadOnlyList<ContentDependencyCheck.Missing> CheckServer(ServerConfig config)

Parameters

config ServerConfig

Returns

IReadOnlyList<ContentDependencyCheck.Missing>

ShouldAsk(int, bool)

Whether to stop and ask the user about what is missing.

public static bool ShouldAsk(int missingCount, bool isAutoRestart)

Parameters

missingCount int
isAutoRestart bool

Returns

bool

Remarks

An automatic start is never interrupted. Auto-restart after a crash and wake-on-demand both happen with nobody in front of the app, so a dialog would leave the server down until somebody came back — which is the exact opposite of what those two features are for. The same guard the port and path checks already use, written where it can be tested.