Skip to content
EvilEngine.Mounts

MountKey class

public sealed class MountKey

A key file the player’s pointer names, read for a game that can’t be read without one. The pointer’s key is an absolute path, and the host reads the file into Externals.Key before it calls Open.

Reading never throws for a bad path. A key that can’t be read keeps its path and says why in Problem, with no Bytes, so the adapter can name it in its notes or its MountException. No adapter the engine ships reads one: keyed readers are players’ own adapters, not first-party ones.

Assembly
EvilEngine.Mounts
Commit
4ff877b1

Members

Longest field

public const int Longest = 4096

4096, the most bytes a key file can hold. A longer file isn’t read.

Path property

public string Path { get; }

The key file’s full path, or the text the pointer gave when that isn’t an absolute path.

Bytes property

public byte[]? Bytes { get; }

The file’s bytes, or null when it couldn’t be read.

Problem property

public string? Problem { get; }

Why the key couldn’t be read, or null when it was: the path isn’t absolute, nothing is there, or it’s longer than Longest.

Read method

public static MountKey Read(string path)

Reads the key file at path. A path that isn’t absolute, a file that isn’t there, a folder, and a file longer than Longest each give a key with a Problem rather than an exception.

ToString method

public override string ToString()

The Path, with the Problem after it in brackets when there is one. just mounts prints it on the key line.