Table of Contents

Class MapNoteStore

Namespace
FishMMO.Client
Assembly
FishMMO.Client.dll

Reads and writes the notes a character has pinned to a scene's map.

public static class MapNoteStore
Inheritance
MapNoteStore
Inherited Members

Remarks

Local, permanently. Notes stay on the machine that wrote them, in the same folder as the explored map. Sharing them would mean player-authored text travelling between clients, which needs server-side length limits, rate limits and a moderation story — a large amount of work in service of a feature nobody has asked for yet. A note is a reminder to yourself, and that is what this supports.

Plain text, not a serialiser. One record per line, fields separated by an ASCII unit separator that no field may contain. A note is six small values; a JSON or binary format would buy nothing and would stop the player opening the file to see what is in it. Anything malformed is skipped rather than aborting the file, so one bad line costs one note.

No signature, unlike the explored map. There is nothing to protect: a forged note draws a pin the player put there themselves. The fog file is signed because it is an input to a progression system; this is not.

Methods

FilePath(long, string)

The file holding one character's notes for one scene.

public static string FilePath(long characterID, string sceneName)

Parameters

characterID long

The character's ID.

sceneName string

The scene's name.

Returns

string

An absolute path. The file may not exist yet.

Remarks

Derived from the explored map's path so the two cannot disagree about which folder a character owns or how a scene name is made safe for a file system.

Load(long, string)

Loads a character's notes for a scene.

public static List<MapNote> Load(long characterID, string sceneName)

Parameters

characterID long

The character's ID.

sceneName string

The scene's name.

Returns

List<MapNote>

The notes. Empty when there are none.

Save(long, string, IReadOnlyList<MapNote>)

Writes a character's notes for a scene.

public static bool Save(long characterID, string sceneName, IReadOnlyList<MapNote> notes)

Parameters

characterID long

The character's ID.

sceneName string

The scene's name.

notes IReadOnlyList<MapNote>

The notes to write. Null or empty deletes the file.

Returns

bool

True when the store was updated.