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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


DefaultChannel Field

Syntax

public static readonly int DefaultChannel

Remarks

Requirements

Namespace: 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

Requirements

Namespace: 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

Parameters

message

The message to send.

handler

Handler to be called when the event completes.

Remarks

Requirements

Namespace: 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.

Syntax

Parameters

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

Requirements

Namespace: 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.

Syntax

public static readonly string Script

Remarks

Requirements

Namespace: 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.

Syntax

public static readonly string Server

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

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.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


Subscribe Method

Subscribes to Chat Events.

Syntax

See 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

Requirements

Namespace: 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.

Syntax

public static readonly string User

Remarks

Requirements

Namespace: 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

Requirements

Namespace: 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

Requirements

Namespace: 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


SourceId Property

Syntax

Value

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


SourceScriptId Property

Syntax

Value

Remarks

Requirements

Namespace: 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

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0



Have more questions? Ask in our Discord!

Last updated