LogoLogo
Scripting DocsSupport
Scripting
Scripting
  • Sinespace Scripting Documentation
  • Client Scripting
    • Viewer
      • SDialogues
      • SInput
      • SShared
      • SUI
    • Network
      • SChat
      • SNetwork
      • SPhotos
      • SVideos
      • SWebService
    • Player
      • SEconomy
      • SGroup
      • SInventory
      • SProfile
      • SQuests
    • Region
      • SCameraManager
      • SGrid
      • SHost
      • SPersistence
      • SPhysics
      • SPostFX
      • SScene
      • SScript
      • SRenderSettings
    • Components
      • SAnimation
      • SAnimator
      • SAudioReactiveAnimation
      • SAudioReactiveBase
      • SAudioReactiveLight
      • SAudioReactiveMaterial
      • SAudioReactiveParticleSystem
      • SAudioReactiveTransform
      • SAudioSource
      • SBoxCollider
      • SBrowserSurface
      • SCamera
      • SCanvasGroup
      • SCapsuleCollider
      • SCharacterController
      • SClickable
      • SCloth
      • SCollider
      • SContentSizeFitter
      • SEmbeddedVideo
      • SEventCalendar
      • SFurniture
      • SGraphicRaycaster
      • SHingeJoint
      • SLight
      • SLineRenderer
      • SMeshRenderer
      • SModularVehicle
      • SNavMeshAgent
      • SNavMeshObstacle
      • SNetworking
      • SParticleSystem
      • SPlayableDirector
      • SPostProcessVolume
      • SRectTransform
      • SReflectionProbe
      • SRenderer
      • SRigidbody
      • SRoomFloor
      • SSceneBackgroundMusic
      • SScriptingData
      • SScriptingEvents
      • SScriptingResources
      • SScriptingRuntime
      • SSeat
      • SSkinnedMeshRenderer
      • SSphereCollider
      • SStateMachine
      • STerrain
      • STrailRenderer
      • SUIButton
      • SUICanvas
      • SUIDropdown
      • SUIImage
      • SUIInputField
      • SUILayout
      • SUIRawImage
      • SUIScrollbar
      • SUISlider
      • SUIText
      • SUIToggle
      • SUIToolTipHint
      • SVirtualCamera
      • SVoiceZone
    • Types
      • SAnimationState
      • SAnimatorStateInfo
      • SAvatar
      • SAvatarAppearance
      • SChatMessage
      • SColor
      • SCommandBuffer
      • SDateTime
      • SGameObject
      • SGenre
      • SGroupInfo
      • SInventoryItem
      • SJointLimits
      • SJointMotor
      • SJointSpring
      • SLandmark
      • SLayerMask
      • SMaterial
      • SMath
      • SMusicDirectory
      • SMusicStation
      • SMusicStationList
      • SNetworkMessageLua
      • SOutfit
      • SParticle
      • SPhysicsHit
      • SPublicRegion
      • SQuaternion
      • SRay
      • SRect
      • SResource
      • SScore
      • SScoreRank
      • SString
      • SSubRegion
      • STrackInfo
      • STuneIn
      • SUIRaycastResult
      • SUserRegions
      • SVector
      • SUserProfile
      • SSocialMedia
      • SWebResponse
  • Server Scripting
    • Library
      • SMath
    • Network
      • SShared
      • SWebservice
    • Region
      • SAvatar
      • SCell
      • SObject
      • SParcel
      • SParcelManager
      • SRegionScript
      • SScene
    • Storage
      • SDatabase
  • Guides
    • Persistence
    • Server Scripts
  • Sample Projects
    • Smart Lights
    • Trivia Box
  • Changelog
    • API Changelog
  • Support
    • Report An Issue
Powered by GitBook

Sinespace® is a registered trademark of Sine Wave Entertainment Ltd, All Rights Reserved.

On this page
  • Index
  • Functions Index
  • Functions
  • SetGlobal
  • GetGlobal
  • RegisterFunction
  • RegisterBroadcastFunction
  • UnregisterBroadcastFunction
  • CallFunction
  • CallBroadcastFunction

Was this helpful?

Export as PDF
  1. Server Scripting
  2. Network

SShared

Index

Functions Index

Function

Functions

SetGlobal

void SetGlobal (string ns, string key, DynValue value)

Sets a global key to a value. The value can be any object type.

Parameter
Type
Description

Space.Shared.SetGlobal("com.someNameHere.world", "version", "1.02");

GetGlobal

DynValue GetGlobal (string ns, string key)

Retrieves a previously set global variable, or returns nil.

Parameter
Type
Description

local versionValue = Space.Shared.GetGlobal("com.someNameHere.world", "version")

RegisterFunction

void RegisterFunction (string ns, string func, Closure reference)

Makes func into a global function that can be accessed anywhere.

Parameter
Type
Description

function someFunction(name)
  Space.Log("Hello " .. name);
end

Space.Shared.RegisterFunction("com.someNameHere.world", "func", someFunction);

RegisterBroadcastFunction

void RegisterBroadcastFunction (string ns, string func, Closure reference)

Makes func into a global function that can be accessed anywhere.

Parameter
Type
Description

function someFunction(name)
  Space.Log("Hello " .. name);
end

Space.Shared.RegisterBroadcastFunction("com.someNameHere.world", "func", someFunction);

UnregisterBroadcastFunction

void UnregisterBroadcastFunction (string ns, string func, Closure reference) void UnregisterBroadcastFunction (string ns, string func)

Unregister Broadcast Function.

Parameter
Type
Description

example 1

CallFunction

void CallFunction (string ns, string func, IEnumerable< DynValue > args)

Calls the registered function with the specified arguments.

Parameter
Type
Description

Space.Shared.CallFunction("com.someNameHere.world", "func",{"Smith"});

CallBroadcastFunction

int CallBroadcastFunction (string ns, string func, IEnumerable< DynValue > args)

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

Parameter
Type
Description

example 1
PreviousNetworkNextSWebservice

Last updated 2 years ago

Was this helpful?

void (string ns, string key, DynValue value)

DynValue (string ns, string key)

void (string ns, string func, Closure reference)

void (string ns, string func, Closure reference)

void (string ns, string func, Closure reference) void UnregisterBroadcastFunction (string ns, string func)

void (string ns, string func, IEnumerable< DynValue > args)

int (string ns, string func, IEnumerable< DynValue > args)

SetGlobal
GetGlobal
RegisterFunction
RegisterBroadcastFunction
UnregisterBroadcastFunction
CallFunction
CallBroadcastFunction