server
Functions
SetPersistent
server.SetPersistent(t: table | buffer,state: boolean) → ()Sets whether the provided table or buffer is persistent in syncdata even if not replicated to anyone.
This should be used for tables you know are guaranteed to be replicated. so that you have a safety guarantee that Syncee's api wont error on it.
SetSchema
server.SetSchema(t: table,schema: (number | string)?) → ()Registers the provided schema to be used for the given table, nil can be provided to remove the schema.
This doesn't need the value to be already in Syncee's registry.
If the schema has sub-schemas, they will be automatically applied to any table present within if they don't have a schema assigned already.
SetRatelimit
server.SetRatelimit(t: table | buffer,ratelimit: number?) → ()Limits the rate of replication for the provided table to atleast 'n' seconds between each replication.
This doesn't need the value to be already in syncee's registry.
Note that this only applies to the provided table/buffer.
Replicate
server.Replicate(t: table,key: any) → ()Replicates the value of the provided key, even if not changed.
ReplicateBufferRegion
server.ReplicateBufferRegion(buf: buffer,start: number,length: number) → ()Marks a region of a buffer for delta replication.
Set
server.Set(t: table,key: any,value: any) → ()Sets 'key' of 't' to 'value', replicates the change then fires TableChangedSignal if present.
GetDataToReplicate
Returns a dictionary mapping each player to a table containing a buffer and an auxillary references array to send to them. Both should be sent to the client.
MarkPlayerLoaded
Marks the given player as loaded and begins replicating the data to them.
GetProxy
server.GetProxy(t: table) → tableReturns a proxy for the provided table that automatically runs Syncee.server.Set() upon any changes. Do not use proxies with server.Set() or manually add them to replicated tables. Unexpected behaviors may occur if this is done.
ProxyToTable
server.ProxyToTable(proxy: table) → table?Returns the original table that this proxy is bound to, if it exists.
Clear
server.Clear(t: table) → ()table.clear(), but replicates the changes if on server. Does not fire change signal.
Insert
server.Insert(t: table,posOrValue: any,value: any?) → ()table.insert(), but replicates the changes if on server and fires change signal.
Remove
server.Remove(t: table,pos: number?) → anytable.remove(), but replicates the changes if on server and fires change signal.
GetRecipients
Returns the players this table/buffer is replicated to.