Class PredictionManager
Additional options for managing the observer system.
Inheritance
Inherited Members
Namespace: FishNet.Managing.Predicting
Assembly: FishNet.Runtime.dll
Syntax
[DisallowMultipleComponent]
[AddComponentMenu("FishNet/Manager/PredictionManager")]
public sealed class PredictionManager : MonoBehaviour
Properties
ClientReplayTick
When not unset this is the current tick which local client is replaying authoraitive inputs on.
Declaration
public uint ClientReplayTick { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
ClientStateTick
Local tick on the most recent performed reconcile.
Declaration
public uint ClientStateTick { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
IsReconciling
True if prediction is currently reconciling. While reconciling run replicates will be replays.
Declaration
public bool IsReconciling { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ServerReplayTick
When not unset this is the current tick which local client is replaying non-authoraitive inputs on.
Declaration
public uint ServerReplayTick { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
ServerStateTick
Server tick on the most recent performed reconcile.
Declaration
public uint ServerStateTick { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
StateOrder
The order in which states are run. Future favors performance and does not depend upon reconciles, while Past favors accuracy but clients must reconcile every tick.
Declaration
public ReplicateStateOrder StateOrder { get; }
Property Value
| Type | Description |
|---|---|
| ReplicateStateOrder |
Methods
GetMaximumServerReplicates()
Maximum number of replicates a server can queue per object. Higher values will put more load on the server and add replicate latency for the client.
Declaration
public byte GetMaximumServerReplicates()
Returns
| Type | Description |
|---|---|
| System.Byte |
GetReconcileStateTick(Boolean)
Returns client or server state tick for the current reconcile.
Declaration
public uint GetReconcileStateTick(bool clientTick)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | clientTick | True to return client state tick, false for servers. |
Returns
| Type | Description |
|---|---|
| System.UInt32 |
SetMaximumServerReplicates(Byte)
Sets the maximum number of replicates a server can queue per object.
Declaration
public void SetMaximumServerReplicates(byte value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte | value |
SetStateOrder(ReplicateStateOrder)
Sets the current ReplicateStateOrder. This may be changed at runtime. Changing this value only affects the client which it is changed on.
Declaration
public void SetStateOrder(ReplicateStateOrder stateOrder)
Parameters
| Type | Name | Description |
|---|---|---|
| ReplicateStateOrder | stateOrder |
Events
OnPostPhysicsTransformSync
Called after Physics SyncTransforms are run after a reconcile. This will only invoke if physics are set to TimeManager, within the TimeManager inspector.
Declaration
public event PredictionManager.PostPhysicsSyncTransformDel OnPostPhysicsTransformSync
Event Type
| Type | Description |
|---|---|
| PredictionManager.PostPhysicsSyncTransformDel |
OnPostReconcile
Called after performing a reconcile. Contains the client and server tick the reconcile is for.
Declaration
public event PredictionManager.PostReconcileDel OnPostReconcile
Event Type
| Type | Description |
|---|---|
| PredictionManager.PostReconcileDel |
OnPostReplicateReplay
Called after physics is simulated when replaying a replicate method.
Declaration
public event PredictionManager.PostReplicateReplayDel OnPostReplicateReplay
Event Type
| Type | Description |
|---|---|
| PredictionManager.PostReplicateReplayDel |
OnPrePhysicsTransformSync
Called before Physics SyncTransforms are run after a reconcile. This will only invoke if physics are set to TimeManager, within the TimeManager inspector.
Declaration
public event PredictionManager.PrePhysicsSyncTransformDel OnPrePhysicsTransformSync
Event Type
| Type | Description |
|---|---|
| PredictionManager.PrePhysicsSyncTransformDel |
OnPreReconcile
Called before performing a reconcile. Contains the client and server tick the reconcile is for.
Declaration
public event PredictionManager.PreReconcileDel OnPreReconcile
Event Type
| Type | Description |
|---|---|
| PredictionManager.PreReconcileDel |
OnPreReplicateReplay
Called before physics is simulated when replaying a replicate method.
Declaration
public event PredictionManager.PreReplicateReplayDel OnPreReplicateReplay
Event Type
| Type | Description |
|---|---|
| PredictionManager.PreReplicateReplayDel |
OnReconcile
Called when performing a reconcile. This is used internally to reconcile objects and does not gaurantee your subscriptions to this event will process before or after internal components.
Declaration
public event PredictionManager.ReconcileDel OnReconcile
Event Type
| Type | Description |
|---|---|
| PredictionManager.ReconcileDel |