Table of Contents

Struct WaypointTravelPolicy

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

The game-wide rule for where a player may fast travel from: when RequireNearbyWaypoint is on, only from within NearbyRange of a waypoint they have discovered in the same scene instance (issue #253). Off, the map's travel button works from anywhere.

public readonly struct WaypointTravelPolicy
Inherited Members

Remarks

Where it is set. The server's InteractableSystem asset owns the values and installs them in Server when it initialises; the travel request reads them from there. The owner client is told the server's values in the WaypointController spawn payload, so the map can grey out its button and say why rather than send a request that will be refused. The client's copy is a hint only — the server re-checks every request.

What counts as the origin. Any live waypoint in the traveller's scene instance, including the destination itself, measured from the waypoint's own transform (the position the map cache bakes). It must be one the traveller has discovered whenever the request also requires the destination to be discovered: a player standing at a stone they never activated has not "used" it. Interacting with a waypoint discovers it, so in play this costs nothing.

Who it binds. The player's own map request. Designer-authored moves (TeleportToWaypointAction — a town-portal item, a quest return) are exempt: being usable away from a waypoint is their point.

Constructors

WaypointTravelPolicy(bool, float)

public WaypointTravelPolicy(bool requireNearbyWaypoint, float nearbyRange)

Parameters

requireNearbyWaypoint bool
nearbyRange float

Fields

Default

The rule as shipped.

public static readonly WaypointTravelPolicy Default

Field Value

WaypointTravelPolicy

DefaultNearbyRange

The shipped origin radius, in metres. A waypoint's interaction range is 3.5 m and using the waypoint is how the travel map opens; the remainder is room to step back from the stone, and for the server's copy of the character lagging the client's.

public const float DefaultNearbyRange = 10

Field Value

float

DefaultRequireNearbyWaypoint

The shipped default: fast travel only from a waypoint.

public const bool DefaultRequireNearbyWaypoint = true

Field Value

bool

MaximumNearbyRange

The ceiling for a configured radius. Past this the rule is no longer "at a waypoint"; turn it off instead.

public const float MaximumNearbyRange = 500

Field Value

float

MinimumNearbyRange

The floor for a configured radius. Below a character's own width nothing would ever qualify.

public const float MinimumNearbyRange = 1

Field Value

float

NearbyRange

How near, in metres. Clamped to [MinimumNearbyRange, MaximumNearbyRange].

public readonly float NearbyRange

Field Value

float

RequireNearbyWaypoint

Refuse a player's travel request unless they stand near a discovered waypoint.

public readonly bool RequireNearbyWaypoint

Field Value

bool

Properties

Server

The rule this server process enforces. Installed by the interactable system at initialisation and restored to Default when it shuts down. Server only; a client reads TravelPolicy instead.

public static WaypointTravelPolicy Server { get; set; }

Property Value

WaypointTravelPolicy

Methods

ClampRange(float)

Brings a configured radius into range. NaN and infinities, which a hand-edited asset or a corrupt payload can carry, become the default rather than a comparison that is always false.

public static float ClampRange(float range)

Parameters

range float

Returns

float

IsSatisfiedBy(WorldSceneDetails, string, IWaypointController, Vector3)

The client's form of the check: whether traveller stands near a waypoint of the map cache's scene that controller has discovered. Always true when the rule is off.

public bool IsSatisfiedBy(WorldSceneDetails details, string sceneName, IWaypointController controller, Vector3 traveller)

Parameters

details WorldSceneDetails

The cached scene the character is in.

sceneName string

The instance-aware scene name the record is keyed by.

controller IWaypointController

The traveller's discovery record.

traveller Vector3

The traveller's position.

Returns

bool

IsWithinRange(Vector3, Vector3)

True when waypoint is within NearbyRange of traveller. Inclusive.

public bool IsWithinRange(Vector3 traveller, Vector3 waypoint)

Parameters

traveller Vector3
waypoint Vector3

Returns

bool