Sinespace Client  2023.2.17543
Client-side scripting for Sinespace
SineSpace.Scripting.Components.SNetworking Class Reference
Inheritance diagram for SineSpace.Scripting.Components.SNetworking:
ScriptClassComponent< SimpleNetworkingBaseInternal >

Public Member Functions

void SendEvent (string eventName)
 Send a networking event event that will be received by other components in the scene with the same network name. More...
 
void ReceiveEvent (string eventName)
 Invoke an event on the networking component. Normally not necessary to do manually, as this happens automatically when receiving a matching event over the network, but may be useful to initialize a state. More...
 

Properties

bool Enabled [get, set]
 Whether the simple networking component is Enabled or not More...
 
bool Instanced [get]
 Returns whether this networking component is instanced or not. More...
 
string NetworkName [get, set]
 Returns or sets the name of the network. Network name must be at least 20 characters long without trailing or leading spaces. More...
 
bool Ready [get]
 Return whether the networking component is ready to send or not (is initialized). More...
 
int EventCount [get]
 Return the number of events this component is waiting to receive. More...
 
string[] EventNames [get]
 Return a list of names of events that this component will receive. More...
 
- Properties inherited from ScriptClassComponent< SimpleNetworkingBaseInternal >
SGameObject GameObject [get]
 Return the GameObject which component added. More...
 

Member Function Documentation

◆ ReceiveEvent()

void SineSpace.Scripting.Components.SNetworking.ReceiveEvent ( string  eventName)

Invoke an event on the networking component. Normally not necessary to do manually, as this happens automatically when receiving a matching event over the network, but may be useful to initialize a state.

local thisObject=Space.Host.ExecutingObject
local networking=thisObject.Networking
networking.ReceiveEvent("Light On")

◆ SendEvent()

void SineSpace.Scripting.Components.SNetworking.SendEvent ( string  eventName)

Send a networking event event that will be received by other components in the scene with the same network name.

local thisObject=Space.Host.ExecutingObject
local networking=thisObject.Networking
networking.SendEvent("Light On")

Property Documentation

◆ Enabled

bool SineSpace.Scripting.Components.SNetworking.Enabled
getset

Whether the simple networking component is Enabled or not

local thisObject=Space.Host.ExecutingObject
local networking=thisObject.Networking
local enabled=networking.Enabled
Space.Log(enabled)

◆ EventCount

int SineSpace.Scripting.Components.SNetworking.EventCount
get

Return the number of events this component is waiting to receive.

local thisObject=Space.Host.ExecutingObject
local networking=thisObject.Networking
local count=networking.EventCount
Space.Log(count)

◆ EventNames

string [] SineSpace.Scripting.Components.SNetworking.EventNames
get

Return a list of names of events that this component will receive.

local thisObject=Space.Host.ExecutingObject
local networking=thisObject.Networking
local names=networking.EventNames
for i=1, #names do
Space.Log(names[i])
end

◆ Instanced

bool SineSpace.Scripting.Components.SNetworking.Instanced
get

Returns whether this networking component is instanced or not.

local thisObject=Space.Host.ExecutingObject
local networking=thisObject.Networking
local instanced=networking.Instanced
Space.Log(instanced)

◆ NetworkName

string SineSpace.Scripting.Components.SNetworking.NetworkName
getset

Returns or sets the name of the network. Network name must be at least 20 characters long without trailing or leading spaces.

local thisObject=Space.Host.ExecutingObject
local networking=thisObject.Networking
local name=networking.NetworkName
Space.Log(name)

◆ Ready

bool SineSpace.Scripting.Components.SNetworking.Ready
get

Return whether the networking component is ready to send or not (is initialized).

local thisObject=Space.Host.ExecutingObject
local networking=thisObject.Networking
local ready=networking.Ready
Space.Log(ready)