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
  • OnChat
  • JoinChat
  • GetXMPPName
  • LeaveChat
  • GetVoiceZone
  • JoinVoice
  • JoinGridVoice
  • LeaveVoice
  • ChangeMediaStatus

Was this helpful?

Export as PDF
  1. Client Scripting
  2. Network

SChat

PreviousNetworkNextSNetwork

Last updated 2 years ago

Was this helpful?

Index

Functions Index

Function Name

Functions

OnChat

void OnChat (Closure callback) void OnChat (Action< > trackInfoCallback)

Bind a function to the OnChat event. This function will be called every time a new chat message is received on the local channel.

Parameter
Type
Description

Space.Network.Chat.OnChat(OnChatFunction) 
--this script takes every new chat message and displays it in a UIText 
uiText = Space.Host.GetReference("text").UIText --Add this Text object as reference in Scripting Runtime

OnChatFunction = function(SChatMessage)
uiText.Text = SChatMessage.Sender ..": " .. SChatMessage.Message 
end

Space.Network.Chat.OnChat(OnChatFunction) 

JoinChat

void JoinChat (string name)

Join a chat channel.

Parameter
Type
Description

Space.Network.Chat.JoinChat("Test room")
--this script will make the player join a chat when entering a trigger collider and leave it when leaving
--[Requires this object to have a "Trigger" collider]

thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar

OTS = function(gameObject)
  if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then 

    Space.Network.Chat.JoinChat("PrivateChatZone")
    
  end

end

OTE = function(gameObject)
  if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then

    Space.Network.Chat.LeaveChat("PrivateChatZone")
    
  end 
  
end


thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)

GetXMPPName

string GetXMPPName (string name)

Get XMPP name.

Parameter
Type
Description

Space.Network.Chat.GetXMPPName("Test room")

LeaveChat

void LeaveChat (string name)

Leave a chat channel.

Parameter
Type
Description

Space.Network.Chat.LeaveChat("Test room")
--this script will make the player join a chat when entering a trigger collider and leave it when leaving
--[Requires this object to have a "Trigger" collider]

thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar

OTS = function(gameObject)
  if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then 

    Space.Network.Chat.JoinChat("PrivateChatZone")
    
  end

end

OTE = function(gameObject)
  if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then

    Space.Network.Chat.LeaveChat("PrivateChatZone")
    
  end 
  
end


thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)

GetVoiceZone

SVoiceZone GetVoiceZone (string channel)

Function Description

Parameter
Type
Description

voiceZone = Space.Network.Chat.GetVoiceZone("AChannel")

JoinVoice

void JoinVoice (string channel, int priority=5, int spatial=0)

Join a voice chat channel.

Parameter
Type
Description

Space.Network.Chat.JoinVoice("PrivateVoiceZone")
--this script will make the player join a voice channel when entering a trigger collider and leave it when leaving
--[Requires this object to have a "Trigger" collider]

thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar

OTS = function(gameObject)
  if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then 

    Space.Network.Chat.JoinVoice("PrivateVoiceZone")
    
  end

end

OTE = function(gameObject)
  if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then

    Space.Network.Chat.LeaveVoice("PrivateVoiceZone")
    
  end 
  
end


thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)

JoinGridVoice

void JoinGridVoice (string channel, int priority=5, int spatial=0)

JoinGridVoice is the same as JoinVoice except with a grid wide parameter. (white-label only)

Parameter
Type
Description

Space.Network.Chat.JoinGridVoice("PrivateGridVoiceZone")
--this script will make the player join a Grid voice channel when entering a trigger collider and leave it when leaving
--[Requires this object to have a "Trigger" collider]

thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar

OTS = function(gameObject)
  if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then 

    Space.Network.Chat.JoinGridVoice("PrivateGridVoiceZone")
    
  end

end

OTE = function(gameObject)
  if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then

    Space.Network.Chat.LeaveVoice("PrivateGridVoiceZone")
    
  end 
  
end


thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)

LeaveVoice

void LeaveVoice (string channel)

Leave a voice chat channel

Parameter
Type
Description

Space.Network.Chat.LeaveVoice("PrivateVoiceZone")
--this script will make the player join a voice channel when entering a trigger collider and leave it when leaving
--[Requires this object to have a "Trigger" collider]

thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar

OTS = function(gameObject)
  if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then 

    Space.Network.Chat.JoinVoice("PrivateVoiceZone")
    
  end

end

OTE = function(gameObject)
  if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then

    Space.Network.Chat.LeaveVoice("PrivateVoiceZone")
    
  end 
  
end


thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)

ChangeMediaStatus

void ChangeMediaStatus (int status)

Function Description

Parameter
Type
Description

Space.Chat.ChangeMediaStatus(1)

void (Closure callback) void (Action< SChatMessage > trackInfoCallback)

void (string name)

string (string name)

void (string name)

SVoiceZone (string channel)

void (string channel, int priority=5, int spatial=0)

void (string channel, int priority=5, int spatial=0)

void (string channel)

void (int status)

SChatMessage
OnChat
OnChat
JoinChat
GetXMPPName
LeaveChat
GetVoiceZone
JoinVoice
JoinGridVoice
LeaveVoice
ChangeMediaStatus