Sync
A fast entity based synchronous networking system
Reference
Functions
entMeta:GetSyncVar(varID, fallback)
View source »Gets the Sync variable on an entity
Parameters
-
varID
int
Sync variable (EG: SYNC_MONEY)
-
fallback
If we don't know the value we will fallback to this value
Returns
-
any
value
entMeta:SetSyncVar(varID, value[, instantSync=false])
View source »Sets the Sync var on an entity
Parameters
-
varID
int
Sync variable (EG: SYNC_MONEY)
-
value
Value to set
-
instantSync
boolean
default: false
If we should network this to all players
entMeta:SyncRemove()
View source »Removes all SyncVar's from an entity and update all players
entMeta:SyncRemoveVar(varID)
View source »Removes a specific SyncVar from an entity and update all players
Parameters
-
varID
int
Sync variable
impulse.Sync.DoType(type, value)
View source »Reads or writes a value based on the SyncType provided
Parameters
-
type
int
SyncType
-
value
impulse.Sync.RegisterVar(type[, conditional=false])
View source »Registers a new Sync variable for usage. Must be called in the shared realm
Parameters
-
type
int
SyncType
-
conditional
boolean
default: false
Is conditional
See Also
meta:SetLocalSyncVar(varID, value)
View source »Sets the Sync var on an entity but only updates the player who it is being set on
Parameters
-
varID
int
Sync variable (EG: SYNC_MONEY)
-
value
Value to set
Tables
SyncDefaults
View source »Default Sync variables
Fields
-
SYNC_RPNAME
-
SYNC_XP
-
SYNX_MONEY
-
SYNC_BANKMONEY
-
SYNC_WEPRAISED
-
SYNC_CLASS
-
SYNC_RANK
-
SYNC_ARRESTED
-
SYNC_HUNGER
-
SYNC_TYPING
-
SYNC_BROKENLEGS
-
SYNC_PROPCOUNT
-
SYNC_CRAFTLEVEL
-
SYNC_THROPHYPOINTS
-
SYNC_INCOGNITO
-
SYNC_GROUP_NAME
-
SYNC_GROUP_RANK
-
SYNC_COS_FACE
-
SYNC_COS_HEAD
-
SYNC_COS_CHEST
-
SYNC_DOOR_NAME
-
SYNC_DOOR_GROUP
-
SYNC_DOOR_BUYABLE
-
SYNC_DOOR_OWNERS
SyncTypes
View source »Types of Sync variable
Fields
-
SYNC_BOOL
A boolean
-
SYNC_STRING
An ASCII string of any length
-
SYNC_INT
An unsigned 8 bit integer
-
SYNC_BIGINT
An unsigned 16 bit integer
-
SYNC_HUGEINT
An unsigned 32 bit integer
-
SYNC_MINITABLE
(Avoid using) A 32 bit compressed table
-
SYNC_INTSTACK
A collection of up to 255 8 bit unsigned integers