Table of Contents

Class CapturePoint

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Capture point interactable for PvP or general objective capture. Tracks ownership, capture progress, and objective state. Fires OnCaptured when a player successfully captures the point. Configured via a CapturePointTemplate ScriptableObject asset.

[RequireComponent(typeof(SceneObjectNamer))]
public class CapturePoint : Interactable, ISpawnable, ICapturePoint, IInteractable, ISceneObject
Inheritance
Object
Component
Behaviour
MonoBehaviour
NetworkBehaviour
CapturePoint
Implements
Inherited Members
NetworkBehaviour.IsSpawned
NetworkBehaviour.ComponentIndex
NetworkBehaviour.NetworkObject
NetworkBehaviour.MAXIMUM_NETWORKBEHAVIOURS
NetworkBehaviour.UNSET_NETWORKBEHAVIOUR_ID
NetworkBehaviour.ToString()
NetworkBehaviour.Reset()
NetworkBehaviour.OnValidate()
NetworkBehaviour.IsBehaviourReconciling
NetworkBehaviour.ClearReplicateCache()
NetworkBehaviour.CreateReconcile()
NetworkBehaviour.Reconcile_Reader<T>(PooledReader, ref T)
NetworkBehaviour.OnStartServerCalled
NetworkBehaviour.OnStartClientCalled
NetworkBehaviour.OnStartNetwork()
NetworkBehaviour.OnStopNetwork()
NetworkBehaviour.OnOwnershipServer(NetworkConnection)
NetworkBehaviour.OnSpawnServer(NetworkConnection)
NetworkBehaviour.OnDespawnServer(NetworkConnection)
NetworkBehaviour.OnStartClient()
NetworkBehaviour.OnStopClient()
NetworkBehaviour.OnOwnershipClient(NetworkConnection)
NetworkBehaviour.ClearBuffedRpcs()
NetworkBehaviour.ExcludeOwnerFromUnbufferedObserversRpcs
NetworkBehaviour.IsClientOnly
NetworkBehaviour.IsServerOnly
NetworkBehaviour.IsHost
NetworkBehaviour.IsClient
NetworkBehaviour.IsServer
NetworkBehaviour.IsDeinitializing
NetworkBehaviour.NetworkManager
NetworkBehaviour.ServerManager
NetworkBehaviour.ClientManager
NetworkBehaviour.ObserverManager
NetworkBehaviour.TransportManager
NetworkBehaviour.TimeManager
NetworkBehaviour.SceneManager
NetworkBehaviour.PredictionManager
NetworkBehaviour.RollbackManager
NetworkBehaviour.NetworkObserver
NetworkBehaviour.IsClientInitialized
NetworkBehaviour.IsClientStarted
NetworkBehaviour.IsClientOnlyInitialized
NetworkBehaviour.IsClientOnlyStarted
NetworkBehaviour.IsServerInitialized
NetworkBehaviour.IsServerStarted
NetworkBehaviour.IsServerOnlyInitialized
NetworkBehaviour.IsServerOnlyStarted
NetworkBehaviour.IsHostInitialized
NetworkBehaviour.IsHostStarted
NetworkBehaviour.IsOffline
NetworkBehaviour.IsNetworked
NetworkBehaviour.GetIsNetworked()
NetworkBehaviour.IsManagerReconciling
NetworkBehaviour.Observers
NetworkBehaviour.IsOwner
NetworkBehaviour.IsController
NetworkBehaviour.HasAuthority
NetworkBehaviour.Owner
NetworkBehaviour.OwnerId
NetworkBehaviour.ObjectId
NetworkBehaviour.LocalConnection
NetworkBehaviour.OwnerMatches(NetworkConnection)
NetworkBehaviour.Despawn(GameObject, DespawnType?)
NetworkBehaviour.Despawn(NetworkObject, DespawnType?)
NetworkBehaviour.Despawn(DespawnType?)
NetworkBehaviour.Spawn(GameObject, NetworkConnection, Scene)
NetworkBehaviour.Spawn(NetworkObject, NetworkConnection, Scene)
NetworkBehaviour.RemoveOwnership()
NetworkBehaviour.GiveOwnership(NetworkConnection)
NetworkBehaviour.GetInstance<T>()
NetworkBehaviour.TryRegisterInstance<T>(T)
NetworkBehaviour.UnregisterInstance<T>()
NetworkBehaviour.CanLog(LoggingType)
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.name
Object.hideFlags

Fields

AchievementTemplate

Achievement to increment when a player captures this point.

public AchievementTemplate AchievementTemplate

Field Value

AchievementTemplate

Template

Template defining capture parameters.

public CapturePointTemplate Template

Field Value

CapturePointTemplate

Properties

CaptureProgress

Current number of capture interactions applied toward the current capture attempt.

public int CaptureProgress { get; set; }

Property Value

int

CapturingCharacterID

Character ID of the player currently attempting to capture this point.

public long CapturingCharacterID { get; set; }

Property Value

long

OwnerCharacterID

Character ID of the player who currently owns this capture point. 0 means neutral.

public long OwnerCharacterID { get; set; }

Property Value

long

State

Current objective state of this capture point.

public ObjectiveState State { get; set; }

Property Value

ObjectiveState

Title

Display title shown above the capture point.

public override string Title { get; }

Property Value

string

TitleColor

Title color for the capture point UI label. Uses olive for a distinct PvP aesthetic.

public override Color TitleColor { get; }

Property Value

Color

Methods

ApplyCapture(long)

Applies one capture interaction toward this point.

public bool ApplyCapture(long characterID)

Parameters

characterID long

The character attempting to capture.

Returns

bool

True if capture completed, false if still in progress or contested.

Remarks

A rival interrupts rather than inherits. The previous version handed the running progress count to whoever touched the point last: it zeroed the count, then immediately set CapturingCharacterID to the newcomer and incremented, so an enemy arriving at a point someone else had almost taken simply continued from one. Worse, it set Contested and then overwrote it with Capturing before returning — the state never came to rest on Contested, so no observer could ever see a point as contested and the enum member was unreachable. An interrupting interaction now breaks the capture and stops there; the rival starts their own attempt on their next interaction.

The interrupt branch only fires while there is live progress to break. Once progress reaches zero — by capture, by decay, or by an interrupt — the captor is cleared too, so a stale ID cannot make an uncontested point read as contested.

CanInteract(IPlayerCharacter)

Returns true if the specified player character may interact with this object.

public override bool CanInteract(IPlayerCharacter character)

Parameters

character IPlayerCharacter

The player character attempting to interact.

Returns

bool

True if interaction is allowed, false otherwise.

Remarks

A pure question with no side effects. It used to stamp the character's interact rate-limit as part of answering, which made it unusable as a check: the scene server, the quest system and the client's input handler all call it, and each call silently consumed a limiter meant for one of the others. A quest accepted within the limiter's window of the interaction that opened the dialogue was refused by a debounce nobody intended to spend, and the refusal path sends nothing back — so the player saw a dead keypress. Spend the limiter explicitly with TryConsumeInteractRateLimit(IPlayerCharacter).

OnAwake()

Called when the object is awakened. Override to implement custom initialization logic.

public override void OnAwake()

OnStartServer()

Registers the scene object and starts the decay clock.

public override void OnStartServer()

OnStopServer()

Drops the decay clock when the server stops running this object.

public override void OnStopServer()

Remarks

ResetState(bool) covers the pooled despawn, but a capture point is normally placed in a scene rather than spawned, and a scene unload does not have to go through the pool. Both routes release through the same flag, so whichever arrives first wins and the second is a no-op.

ReadPayload(NetworkConnection, Reader)

Reads capture point state from the network payload.

public override void ReadPayload(NetworkConnection connection, Reader reader)

Parameters

connection NetworkConnection
reader Reader

ResetState(bool)

Clears ownership and capture progress when this instance returns to the pool.

public override void ResetState(bool asServer)

Parameters

asServer bool

True when the reset is for the server instance.

Remarks

All four fields are per-life state. Without this a recycled capture point comes back still owned by whoever held it in its previous life — and CanInteract(IPlayerCharacter) refuses the owner outright, so that player could never take it again.

WritePayload(NetworkConnection, Writer)

Writes capture point state to the network payload.

public override void WritePayload(NetworkConnection connection, Writer writer)

Parameters

connection NetworkConnection
writer Writer