Chat
Chat, subscription handler, and data docs
Chat Class
The Chat class handles chat subscriptions and sending messages to users and other scripts.
Syntax
Member Details
AllChannels Field
Syntax[Sansar.Script.Interface] [System.Obsolete("All channel subscription no longer allowed", false)] public static readonly int AllChannels
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
DefaultChannel Field
Syntaxpublic static readonly int DefaultChannel
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
MessageAllUsers Method
Send a chat message to every user in the Experience.
Syntax[Sansar.Script.Interface] public void MessageAllUsers (string message)
Parameters
message
The message to send.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
MessageAllUsers Method
Send a chat message to every user in the Experience.
SyntaxParameters
message
The message to send.
handler
Handler to be called when the event completes.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
MessageScript Method
Send a string message to a specific script.
SyntaxParameters
message
The message to send.
scriptId
The id of the script to send the message to.
channel
The channel to send the message on.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Script Field
Indicates that the chat message originated from a script.
Syntaxpublic static readonly string Script
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Server Field
Indicates that the chat message originated from the server.
Syntaxpublic static readonly string Server
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
SourceScriptId
Sansar.Script.ScriptId id of the chat source. May be Sansar.Script.ScriptId.Invalid if the source is not a script.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
SourceId
Sansar.Script.SessionId id of the chat source. May be Sansar.Script.SessionId.Invalid if the source is not an agent.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
Channel
int channel which the chat occurs on.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
Source
string source of the chat: system, user or script.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
Channel
int channel which the chat occurs on.
SourceScriptId
Sansar.Script.ScriptId id of the chat source. May be Sansar.Script.ScriptId.Invalid if the source is not a script.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
Channel
int channel which the chat occurs on.
SourceId
Sansar.Script.SessionId id of the chat source. May be Sansar.Script.SessionId.Invalid if the source is not an agent.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
Syntax[Sansar.Script.Interface] [System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.ChatData>", false)] public void Subscribe (int Channel, string Source, Chat.SubscriptionHandler callback, bool persistent)
Parameters
Channel
int channel which the chat occurs on.
Source
string source of the chat: system, user or script.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
Channel
int channel which the chat occurs on.
Source
string source of the chat: system, user or script.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
Source
string source of the chat: system, user or script.
SourceScriptId
Sansar.Script.ScriptId id of the chat source. May be Sansar.Script.ScriptId.Invalid if the source is not a script.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
Source
string source of the chat: system, user or script.
SourceId
Sansar.Script.SessionId id of the chat source. May be Sansar.Script.SessionId.Invalid if the source is not an agent.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
Syntax[Sansar.Script.Interface] [System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.ChatData>", false)] public void Subscribe (int Channel, string Source, Sansar.Script.ScriptId SourceScriptId, Chat.SubscriptionHandler callback, bool persistent)
Parameters
Channel
int channel which the chat occurs on.
Source
string source of the chat: system, user or script.
SourceScriptId
Sansar.Script.ScriptId id of the chat source. May be Sansar.Script.ScriptId.Invalid if the source is not a script.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
Channel
int channel which the chat occurs on.
Source
string source of the chat: system, user or script.
SourceScriptId
Sansar.Script.ScriptId id of the chat source. May be Sansar.Script.ScriptId.Invalid if the source is not a script.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
Syntax[Sansar.Script.Interface] [System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.ChatData>", false)] public void Subscribe (int Channel, string Source, Sansar.Script.SessionId SourceId, Chat.SubscriptionHandler callback, bool persistent)
Parameters
Channel
int channel which the chat occurs on.
Source
string source of the chat: system, user or script.
SourceId
Sansar.Script.SessionId id of the chat source. May be Sansar.Script.SessionId.Invalid if the source is not an agent.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
Channel
int channel which the chat occurs on.
Source
string source of the chat: system, user or script.
SourceId
Sansar.Script.SessionId id of the chat source. May be Sansar.Script.SessionId.Invalid if the source is not an agent.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxParameters
Channel
int channel which the chat occurs on.
Source
string source of the chat: system, user or script.
SourceId
Sansar.Script.SessionId id of the chat source. May be Sansar.Script.SessionId.Invalid if the source is not an agent.
SourceScriptId
Sansar.Script.ScriptId id of the chat source. May be Sansar.Script.ScriptId.Invalid if the source is not a script.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribe Method
Subscribes to Chat Events.
SyntaxSee Also
Parameters
Channel
int channel which the chat occurs on.
Source
string source of the chat: system, user or script.
SourceId
Sansar.Script.SessionId id of the chat source. May be Sansar.Script.SessionId.Invalid if the source is not an agent.
SourceScriptId
Sansar.Script.ScriptId id of the chat source. May be Sansar.Script.ScriptId.Invalid if the source is not a script.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
User Field
Indicates that the chat message originated from a user.
Syntaxpublic static readonly string User
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Chat.SubscriptionHandler Delegate
Subscribe to receive events on chat messages from the system, users or scripts.
Parameters
Channel
int channel which the chat occurs on.
Source
string source of the chat: system, user or script.
SourceId
Sansar.Script.SessionId id of the chat source. May be Sansar.Script.SessionId.Invalid if the source is not an agent.
SourceScriptId
Sansar.Script.ScriptId id of the chat source. May be Sansar.Script.ScriptId.Invalid if the source is not a script.
Message
string message of the chat event.
Remarks
Requirements
Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
ChatData Class
Subscribe to receive events on chat messages from the system, users or scripts.
Syntax
Member Details
Channel Property
int channel which the chat occurs on.
Syntax[get: Sansar.Script.Interface] public int Channel { get; }
Value
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Message Property
string message of the chat event.
Syntax[get: Sansar.Script.Interface] public string Message { get; }
Value
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Source Property
string source of the chat: system, user or script.
Syntax[get: Sansar.Script.Interface] public string Source { get; }
Value
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
SourceId Property
SyntaxValue
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
SourceScriptId Property
SyntaxValue
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
ToString Method
A string representation of this object.
Syntax[Sansar.Script.Interface] public override string ToString ()
Returns
A string representation of this object.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Have more questions? Ask in our Discord!
Last updated