Table of Contents

Class PlotEviction

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Where somebody standing on a plot they may no longer be on is put instead.

public static class PlotEviction
Inheritance
PlotEviction
Inherited Members

Remarks

Access rules that only apply at the boundary are access rules a player can defeat by not crossing it. Standing still while a friend revokes their key, or while the owner starts building, would otherwise leave them inside a house they are now barred from — and logging out there would let them come back to it. Eviction is what makes the answer to "may I be here" the same as the answer to "may I come in".

Pure geometry, kept apart from the systems that act on it: the arithmetic is where the mistakes are, and a mistake here puts a player inside a wall or under the map.

Fields

BoundaryMargin

How far past the boundary an evicted player is placed, in metres.

public const float BoundaryMargin = 1.5

Field Value

float

Remarks

Not zero. Landing exactly on the edge leaves a body whose own radius still overlaps the plot, which the next check reads as still inside — so the player is evicted again, and again, and is held rattling against the boundary instead of being put outside it.

Methods

IsInsideFootprint(Bounds, Vector3)

True when a point is over the plot's footprint, whatever its height.

public static bool IsInsideFootprint(Bounds plotBounds, Vector3 position)

Parameters

plotBounds Bounds
position Vector3

Returns

bool

Remarks

Height is ignored on purpose, and this is why eviction does not simply reuse Bounds.Contains. A plot's volume stops a dozen metres up; a player who has climbed onto the roof of their own house, or is falling past it, is over the plot and out of the box at the same time. Treating them as outside would leave the one position from which somebody can watch a house they are barred from.

NearestExit(Bounds, Vector3, float)

The nearest point outside a plot, at the same height.

public static Vector3 NearestExit(Bounds plotBounds, Vector3 position, float margin = 1.5)

Parameters

plotBounds Bounds

The plot's volume.

position Vector3

Where the player is now.

margin float

How far past the edge to place them.

Returns

Vector3

Remarks

Horizontal only. The plot is a box with a top and a bottom, and the nearest face to somebody standing on the ground floor is very often the floor — so a nearest-face eviction would drop players through the terrain. Height is left exactly as it was, which keeps them on whatever they were standing on.

Ties go to the positive axis rather than being resolved randomly. Somebody dead in the centre of a square plot is equidistant from all four sides, and two callers reaching different answers for the same player is how one system evicts them east while another decides they are still inside.