Table of Contents

Class WaypointPersistence

Namespace
FishMMO.Server.Implementation.World.SceneServer
Assembly
FishMMO.Server.dll

The one place a character's discovered-waypoint pages are turned into rows and merged. Used by the unlock path (write on change) and by the character system's periodic and despawn saves (retry of anything still dirty).

public static class WaypointPersistence
Inheritance
WaypointPersistence
Inherited Members

Remarks

The database merge is an OR, so both callers may write the same page without either losing bits, and neither needs to know about the other. What each caller does with the result — confirming the pages on the main thread — is the same too, hence MarkPersisted(List<CharacterWaypointData>, Func<long, ICharacter>).

Methods

AppendDirtyPages(ICharacter, List<CharacterWaypointData>, List<WaypointPageSnapshot>)

Appends every dirty page of a character's record.

public static int AppendDirtyPages(ICharacter character, List<CharacterWaypointData> results, List<WaypointPageSnapshot> scratch)

Parameters

character ICharacter
results List<CharacterWaypointData>
scratch List<WaypointPageSnapshot>

Returns

int

The number of pages appended.

MarkPersisted(List<CharacterWaypointData>, Func<long, ICharacter>)

Confirms written pages on their characters. Main thread only.

public static void MarkPersisted(List<CharacterWaypointData> pages, Func<long, ICharacter> resolve)

Parameters

pages List<CharacterWaypointData>

The rows that were merged.

resolve Func<long, ICharacter>

Finds a resident character by ID, or null.

MergeAsync(ICharacterWaypointService, List<CharacterWaypointData>, string)

Merges rows into the database.

public static Task<bool> MergeAsync(ICharacterWaypointService service, List<CharacterWaypointData> pages, string tag)

Parameters

service ICharacterWaypointService
pages List<CharacterWaypointData>
tag string

Returns

Task<bool>

True when the merge landed.

ToData(long, in WaypointPageSnapshot)

Turns a controller page into its row.

public static CharacterWaypointData ToData(long characterID, in WaypointPageSnapshot page)

Parameters

characterID long
page WaypointPageSnapshot

Returns

CharacterWaypointData