Enfusion Script API
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
Replication Interface Reference

Main replication API. More...

Static Public Member Functions

static proto RplId FindId (Managed entity)
 Looks for RplId assigned by the Replication layer.
 
static proto Managed FindItem (RplId itemId)
 Looks for Item of the provided id.
 
static proto RplIdentity FindOwner (RplId itemId)
 Tries to look for the owner of provided replication id.
 
static proto bool IsRunning ()
 Tells whenever the replication is active.
 
static proto bool Runtime ()
 The replication is currently in runtime mode.
 
static proto bool Loadtime ()
 The replication is currently in state of world loading.
 
static proto void BumpMe ()
 Notifies replication systems about changes in your object and queues him for replication in near future.
 
static proto void SetNumVirtualConnections (int num)
 Sets the number of virtual connections which are just generating load for the master.
 
static proto bool IsServer ()
 
static proto bool IsClient ()
 
static proto ref RplConnectionStats GetConnectionStats (RplIdentity identity)
 Retrieve snapshot of connection statistics for given identity at current moment in time.
 

Static Public Attributes

const RplId INVALID_ID = 0xFFFFFFFF
 
const RplIdentity INVALID_IDENTITY = 0xFFFFFFFF
 

Detailed Description

Main replication API.

Member Function Documentation

◆ BumpMe()

static proto void Replication.BumpMe ( )
static

Notifies replication systems about changes in your object and queues him for replication in near future.

◆ FindId()

static proto RplId Replication.FindId ( Managed  entity)
static

Looks for RplId assigned by the Replication layer.

Warning
It is a lookup! Don't use in tight loops!
Returns
id or INVALID_ID if entity is not part of the replication process.

◆ FindItem()

static proto Managed Replication.FindItem ( RplId  itemId)
static

Looks for Item of the provided id.

Returns
Item or null when no item with provided id exists.

◆ FindOwner()

static proto RplIdentity Replication.FindOwner ( RplId  itemId)
static

Tries to look for the owner of provided replication id.

When successful returns its identity. Failure returns INVALID_ID constant.

◆ GetConnectionStats()

static proto ref RplConnectionStats Replication.GetConnectionStats ( RplIdentity  identity)
static

Retrieve snapshot of connection statistics for given identity at current moment in time.

This snapshot is not updated over time. To always get up-to-date statistics, call this function repeatedly. Rate of updates of internal statistics is not well defined, but it can be expected to happen about once every two seconds (usually more often). Note that only server is able to access connection information of all clients connected to it.

When identity is identifier of a real connection (such as from client to server), these will be statistics for that connection.

When identity is RplIdentity.Local(), returned statistics are for local player. Local player on server does not suffer from any connection quality issues and statistics will report perfect values (such as zero round-trip time). Local player on client reports statistics from its real connection to the server (as if identity was identifier of that connection).

When identity is RplIdentity.Invalid() or it refers to non-existent connection, null is returned.

Parameters
[in]identityIdentifier of queried connection.
Returns
Statistics of a given connection, or null when identity is wrong.

◆ IsClient()

static proto bool Replication.IsClient ( )
static
Warning
Using the hardcoded IsClient will result in code thats not modular and won't adapt when running in different environment consider using the replication roles and ownership instead.

◆ IsRunning()

static proto bool Replication.IsRunning ( )
static

Tells whenever the replication is active.

◆ IsServer()

static proto bool Replication.IsServer ( )
static
Warning
Using the hardcoded IsServer will result in code thats not modular and won't adapt when running in different environment consider using the replication roles and ownership instead.

◆ Loadtime()

static proto bool Replication.Loadtime ( )
static

The replication is currently in state of world loading.

The inserted nodes will receive a loadtime IDs and have to be spawned/present on both (Server and Client).

◆ Runtime()

static proto bool Replication.Runtime ( )
static

The replication is currently in runtime mode.

The inserted nodes will receive a runtime IDs they will be automatically replicated to relevant clients.

◆ SetNumVirtualConnections()

static proto void Replication.SetNumVirtualConnections ( int  num)
static

Sets the number of virtual connections which are just generating load for the master.

Warning
INTERNAL PROFILING FEATURE ONLY!

Member Data Documentation

◆ INVALID_ID

const RplId Replication.INVALID_ID = 0xFFFFFFFF
static

◆ INVALID_IDENTITY

const RplIdentity Replication.INVALID_IDENTITY = 0xFFFFFFFF
static

The documentation for this interface was generated from the following file: