Table of Contents

Class BuffVolumeController

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Applies and removes BuffVolume buffs from inside the prediction replicate, so a character gets a region's buff on the step it walks in rather than a round trip later.

[DisallowMultipleComponent]
public class BuffVolumeController : CharacterBehaviour, ICharacterBehaviour, IPredictableController
Inheritance
Object
Component
Behaviour
MonoBehaviour
NetworkBehaviour
BuffVolumeController
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.RequestReconcileSends()
NetworkBehaviour.CreateReconcile()
NetworkBehaviour.Reconcile_Reader_Remote<T>(PooledReader, ref T)
NetworkBehaviour.ClearBuffedRpcs()
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)
NetworkBehaviour.OnStartServerCalled
NetworkBehaviour.OnStartClientCalled
NetworkBehaviour.WritePayload(NetworkConnection, Writer)
NetworkBehaviour.ReadPayload(NetworkConnection, Reader)
NetworkBehaviour.OnStartNetwork()
NetworkBehaviour.OnStopNetwork()
NetworkBehaviour.OnStartServer()
NetworkBehaviour.OnStopServer()
NetworkBehaviour.OnOwnershipServer(NetworkConnection)
NetworkBehaviour.OnSpawnServer(NetworkConnection)
NetworkBehaviour.OnDespawnServer(NetworkConnection)
NetworkBehaviour.OnStartClient()
NetworkBehaviour.OnStopClient()
NetworkBehaviour.OnOwnershipClient(NetworkConnection)
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.MemberwiseClone()
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

Remarks

It keeps no state that has to be sent. Which volumes contain a character is a pure function of that character's position, and the position already reconciles — so this controller adds nothing to CharacterReconcileData. The set it holds is rebuilt from the position every tick rather than carried forward, which is what makes a replay of that tick produce the same answer as the first run of it.

Only volumes it put on come off. The controller remembers which buffs it applied and removes only those, so a region buff never strips a buff of the same template that an ability or an item granted. The buffs themselves live in BuffController and reconcile the way every other buff does.

See BuffVolume for why this is a position test and not a trigger (N13).

Fields

VerboseLogging

[Tooltip("Log every volume entered and left. Noisy; for working on region buffs only.")]
public bool VerboseLogging

Field Value

bool

Properties

AppliedCount

How many volume buffs are currently held. For tests and the debug overlay.

public int AppliedCount { get; }

Property Value

int

Order

After movement (KCCPlayer, 80) so the position tested is this tick's, after weather exposure (83) so the two agree about the weather, and before buffs (BuffController, 85) so anything applied here is ticked in the same step.

public int Order { get; }

Property Value

int

Methods

IsInside(BuffVolume)

True while this volume's buff is on because of this controller.

public bool IsInside(BuffVolume volume)

Parameters

volume BuffVolume

Returns

bool

OnCreateReconcile(ref CharacterReconcileData)

Writes this controller's authoritative state into the reconcile data (server only). Called once per tick after OnReplicate(ref CharacterReplicateData, ReplicateState, Channel).

public void OnCreateReconcile(ref CharacterReconcileData reconcileData)

Parameters

reconcileData CharacterReconcileData

OnReconcile(CharacterReconcileData, Channel)

Restores this controller's state from the server's authoritative reconcile data.

public void OnReconcile(CharacterReconcileData rd, Channel channel)

Parameters

rd CharacterReconcileData
channel Channel

OnReplicate(ref CharacterReplicateData, ReplicateState, Channel)

Executes this controller's simulation for the current tick. May modify input for observer prediction.

public void OnReplicate(ref CharacterReplicateData input, ReplicateState state, Channel channel)

Parameters

input CharacterReplicateData
state ReplicateState
channel Channel

PopulateInput(ref CharacterReplicateData)

Populates this controller's portion of the unified input data (owner only). Called once per tick before OnReplicate(ref CharacterReplicateData, ReplicateState, Channel).

public void PopulateInput(ref CharacterReplicateData input)

Parameters

input CharacterReplicateData

ResetState(bool)

Resets this NetworkBehaviour so that it may be added to an object pool.

public override void ResetState(bool asServer)

Parameters

asServer bool