Class WaypointSceneAudit
- Namespace
- FishMMO.Server.Implementation.World.SceneServer
- Assembly
- FishMMO.Server.dll
Checks, once per loaded scene, that the waypoints the client can see are the waypoints the server can travel to.
public static class WaypointSceneAudit
- Inheritance
-
WaypointSceneAudit
- Inherited Members
Remarks
The map draws from the baked Waypoints; the server resolves a travel request from the live WaypointRegistry. They are keyed the same way, (scene, index), and nothing else ties them together. A waypoint added to a scene without a cache rebuild is discoverable on foot and then invisible on every map; a waypoint in the cache whose object no longer spawns is drawn and refused. Both are silent authoring drift, and the only place that holds both sides at once is a scene server that has just finished loading the scene.
The comparison is a pure function over the two index sets so it can be pinned by a test; the scene-server hook only gathers the inputs and logs the answer.
Methods
Audit(string, int, WorldSceneDetailsCache)
Runs the comparison for a scene that has finished loading and reports drift as errors.
public static bool Audit(string sceneName, int sceneHandle, WorldSceneDetailsCache cache)
Parameters
sceneNamestringThe scene's name, as the cache keys it.
sceneHandleintThe loaded scene's handle, as the registry keys it.
cacheWorldSceneDetailsCacheThe world scene details cache this server is running with.
Returns
- bool
True when nothing is wrong.
Compare(IEnumerable<int>, IEnumerable<int>, List<int>, List<int>)
Compares the live and baked waypoint indices of one scene.
public static bool Compare(IEnumerable<int> live, IEnumerable<int> baked, List<int> liveOnly, List<int> bakedOnly)
Parameters
liveIEnumerable<int>Indices registered by spawned
Waypointobjects.bakedIEnumerable<int>Indices in the world scene details cache.
liveOnlyList<int>Live but not baked: the map will never draw them.
bakedOnlyList<int>Baked but not live: the map draws them and travel is refused.
Returns
- bool
True when the two sets agree.