Enfusion Script API
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations
Replication

Classes

interface  Replication
 Main replication API. More...
 
interface  RplConnectionStats
 
interface  RplId
 Replication item identifier. More...
 
interface  RplIdentity
 Replication connection identity. More...
 
interface  ScriptCtx
 
interface  RplProp
 Property annotation attribute. More...
 
interface  RplRpc
 RPC annotation attribute. More...
 
interface  OnRpl
 OnReplication annotation attribute. More...
 
interface  RplBeforeInjected
 
interface  RplBeforeExtracted
 
interface  ScriptBitWriter
 
interface  ScriptBitReader
 
interface  ScriptBitSerializer
 
interface  SSnapSerializerBase
 
interface  SSnapshot
 Binary data container used in conjuction with a serializer. More...
 
interface  SSnapSerializer
 Snapshot serializer utility. More...
 
interface  Scheduler
 
interface  RplSessionCallbacks
 

Typedefs

typedef int RplIdentity
 
typedef int RplId
 

Enumerations

enum  RplChannel { RplChannel.Reliable , RplChannel.Unreliable }
 Communication channel. Reliable is guaranteed to be delivered. Unreliable not. More...
 
enum  RplCondition { RplCondition.None , RplCondition.OwnerOnly , RplCondition.NoOwner , RplCondition.Custom }
 Conditional replication rule. Fine grained selection of receivers. More...
 
enum  RplError {
  RplError.SYSTEM_FAILURE , RplError.DISCONNECTION , RplError.CONNECTION_FAILURE , RplError.TIMEOUT ,
  RplError.FLOODED , RplError.STALLED , RplError.SERVICE_FAILURE , RplError.JIP_ERROR ,
  RplError.SHUTDOWN , RplError.CREATION_FAILURE
}
 
enum  RplGroup {
  RplGroup.Mandatory , RplGroup.Group_1 , RplGroup.Group_2 , RplGroup.Group_3 ,
  RplGroup.Group_4 , RplGroup.Group_5 , RplGroup.Group_6
}
 Property groups that allow for replication of only part of the object. More...
 
enum  RplRcver { RplRcver.Server , RplRcver.Owner , RplRcver.Broadcast }
 Target of the RPC call. More...
 
enum  RplRole { RplRole.Authority , RplRole.Proxy }
 Role of replicated node (and all items in it) within the replication system. More...
 
enum  RplStateOverride { RplStateOverride.None , RplStateOverride.Runtime }
 Used to override the current replication game state during node hierarchy insertion. More...
 
enum  ERplStateOverride { ERplStateOverride.None = RplStateOverride.None , ERplStateOverride.Static = RplStateOverride.None , ERplStateOverride.Dynamic = RplStateOverride.Runtime }
 

Detailed Description

  1. Replication overview
  2. RplNode
  3. Replicating entities, components and hierarchies
  4. Loadtime and Runtime

Typedef Documentation

◆ RplId

typedef int RplId

◆ RplIdentity

typedef int RplIdentity

Enumeration Type Documentation

◆ ERplStateOverride

Deprecated:
Use RplStateOverride instead.
Enumerator
None 
Static 
Dynamic 

◆ RplChannel

enum RplChannel

Communication channel. Reliable is guaranteed to be delivered. Unreliable not.

Enumerator
Reliable 
Unreliable 

◆ RplCondition

Conditional replication rule. Fine grained selection of receivers.

Enumerator
None 

Sent to all relevant by role only.

OwnerOnly 

Sent to owner only.

NoOwner 

Sent to everybody but owner.

Custom 

Sent to everybody who fulfills the custom condition.

◆ RplError

enum RplError
Enumerator
SYSTEM_FAILURE 
DISCONNECTION 
CONNECTION_FAILURE 
TIMEOUT 
FLOODED 
STALLED 
SERVICE_FAILURE 
JIP_ERROR 
SHUTDOWN 
CREATION_FAILURE 

◆ RplGroup

enum RplGroup

Property groups that allow for replication of only part of the object.

Enumerator
Mandatory 
Group_1 
Group_2 
Group_3 
Group_4 
Group_5 
Group_6 

◆ RplRcver

enum RplRcver

Target of the RPC call.

RPC delivery depends on multiple factors: replication mode of caller, ownership and RPC receiver value. An RPC may be dropped, executed directly on the caller, or routed to remote instances. Which remote instances will RPC be routed to depends on RplRcver value and evaluation of RplCondition.

Full routing table for RPCs:

caller mode caller is owner receiver action
Server yes Server direct call
Owner direct call
Broadcast routed call (to relevant clients)
no Server direct call
Owner routed call (to owner client)
Broadcast routed call (to relevant clients)
Client yes Server routed call (to server)
Owner direct call
Broadcast direct call
no Server dropped
Owner dropped
Broadcast direct call

Note that evaluating RplCondition can drop an RPC, even if according to routing table the call would be executed directly or routed.

Simplified version of the above table that may be easier to think about:

Mode = SERVER

Server Owner Broadcast
Owner self self all clients
Not Owner self client all clients

Mode = CLIENT

Server Owner Broadcast
Owner server self self
Not Owner drop drop self

When using broadcast, relevant clients are those who have the item through which broadcast is sent streamed in. A broadcast sent before an item is streamed to a client will not arrive on given client. When using broadcasts, you should always consider what will happen in a situation when item is streamed to the client after the broadcast has been sent.

Enumerator
Server 

Server side.

Owner 

Instance owner.

Broadcast 

Instances with proxy role.

◆ RplRole

enum RplRole

Role of replicated node (and all items in it) within the replication system.

Enumerator
Authority 

The state will be replicated to proxies.

Proxy 

Can't replicate state to others, only receives state from authority.

◆ RplStateOverride

Used to override the current replication game state during node hierarchy insertion.

Enumerator
None 
Runtime