Sinespace Client 2025.3.19431
Client-side scripting for Sinespace
SineSpace.Scripting.Client.SShared Class Reference
Inheritance diagram for SineSpace.Scripting.Client.SShared:
ScriptClass

Public Member Functions

override void Initialise (SScript runtime, object wrapper)
 
void SetGlobal (string ns, string key, DynValue value)
 
void SetSuperGlobal (string ns, string key, DynValue value)
 
DynValue GetGlobal (string ns, string key)
 Retrieves a previously set global variable, or returns nil.
 
DynValue GetSuperGlobal (string ns, string key)
 Retrieves a previously set superglobal variable, or returns nil.
 
void RegisterFunction (string ns, string func, Closure reference)
 
void RegisterBroadcastFunction (string ns, string func, Closure reference)
 
void UnregisterBroadcastFunction (string ns, string func, Closure reference)
 
void UnregisterBroadcastFunction (string ns, string func)
 
void CallFunction (string ns, string func, IEnumerable< DynValue > args)
 
int CallBroadcastFunction (string ns, string func, IEnumerable< DynValue > args)
 Calls every registered broadcast function with specified arguments, and returns the number of calls queued.
 
- Public Member Functions inherited from ScriptClass
void ReportError (string error, bool fatal, UnityEngine.Object target=null)
 
void Initialise (SScript runtime, object wrapper)
 

Additional Inherited Members

- Protected Member Functions inherited from ScriptClass
void Initialise (SScript runtime)
 
- Properties inherited from ScriptClass
virtual bool Alive [get]
 
DynValue CachedData [get, set]
 

Member Function Documentation

◆ CallBroadcastFunction()

int SineSpace.Scripting.Client.SShared.CallBroadcastFunction ( string ns,
string func,
IEnumerable< DynValue > args )

Calls every registered broadcast function with specified arguments, and returns the number of calls queued.

Functions will be called at the start of their next execution context, which may be in the next frame.

Parameters
ns
func
args
Returns

◆ CallFunction()

void SineSpace.Scripting.Client.SShared.CallFunction ( string ns,
string func,
IEnumerable< DynValue > args )

◆ GetGlobal()

DynValue SineSpace.Scripting.Client.SShared.GetGlobal ( string ns,
string key )

Retrieves a previously set global variable, or returns nil.

These variables are shared between scripts, hence a namespace is required

Parameters
nsA namespace, suggest using reverse-DNS ordering, e.g. com.sinewaveentertainment.someScript
keyA individual key name for a variable
Returns

◆ GetSuperGlobal()

DynValue SineSpace.Scripting.Client.SShared.GetSuperGlobal ( string ns,
string key )

Retrieves a previously set superglobal variable, or returns nil.

Unlike globals, superglobals are not reset by a teleport to another scene.

These variables are shared between scripts, hence a namespace is required

Parameters
nsA namespace, suggest using reverse-DNS ordering, e.g. com.sinewaveentertainment.someScript
keyA individual key name for a variable
Returns

◆ Initialise()

override void SineSpace.Scripting.Client.SShared.Initialise ( SScript runtime,
object wrapper )

◆ RegisterBroadcastFunction()

void SineSpace.Scripting.Client.SShared.RegisterBroadcastFunction ( string ns,
string func,
Closure reference )

◆ RegisterFunction()

void SineSpace.Scripting.Client.SShared.RegisterFunction ( string ns,
string func,
Closure reference )

◆ SetGlobal()

void SineSpace.Scripting.Client.SShared.SetGlobal ( string ns,
string key,
DynValue value )

◆ SetSuperGlobal()

void SineSpace.Scripting.Client.SShared.SetSuperGlobal ( string ns,
string key,
DynValue value )

◆ UnregisterBroadcastFunction() [1/2]

void SineSpace.Scripting.Client.SShared.UnregisterBroadcastFunction ( string ns,
string func )

◆ UnregisterBroadcastFunction() [2/2]

void SineSpace.Scripting.Client.SShared.UnregisterBroadcastFunction ( string ns,
string func,
Closure reference )