Chat

Chat Class

The Chat class handles chat subscriptions and sending messages to users and other scripts.

Syntax

[Sansar.Script.Interface]
public class Chat : Sansar.Script.InstanceInterface

Remarks

 

Requirements

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

Members

See Also: Inherited members from Sansar.Script.InstanceInterface.

Public Fields

static readonly
AllChannels int . Use as the channel argument for Chat.Subscribe(int, string, Action<Sansar.Simulation.ChatData>,System.Boolean) to subscribe to all channels.
static readonly
DefaultChannel int . Use as the channel argument for Chat.Subscribe(int, string, Action<Sansar.Simulation.ChatData>,System.Boolean) to subscribe to the default channel
static readonly
Script string . Indicates that the chat message originated from a script.
static readonly
Server string . Indicates that the chat message originated from the server.
static readonly
User string . Indicates that the chat message originated from a user.

Public Properties

[read-only]
 
IsValid bool . Whether or not this interface is valid. (Inherited from Sansar.Script.InstanceInterface.)

Public Methods

 
MessageAllUsers (string)
Send a chat message to every user in the Experience.
 
MessageAllUsers (string, Action<Sansar.Script.OperationCompleteEvent>)
Send a chat message to every user in the Experience.
 
MessageScript (string, Sansar.Script.ScriptId, int)
Send a string message to a specific script.
 
Subscribe (Sansar.Script.ScriptId, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.
 
Subscribe (Sansar.Script.SessionId, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.
 
Subscribe (int, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.
 
Subscribe (string, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.
 
Subscribe (int, Sansar.Script.ScriptId, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.
 
Subscribe (int, Sansar.Script.SessionId, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.
 
Subscribe (int, string, Chat.SubscriptionHandler, bool)
Subscribes to Chat Events.
 
Subscribe (int, string, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.
 
Subscribe (string, Sansar.Script.ScriptId, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.
 
Subscribe (string, Sansar.Script.SessionId, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.
 
Subscribe (int, string, Sansar.Script.ScriptId, Chat.SubscriptionHandler, bool)
Subscribes to Chat Events.
 
Subscribe (int, string, Sansar.Script.ScriptId, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.
 
Subscribe (int, string, Sansar.Script.SessionId, Chat.SubscriptionHandler, bool)
Subscribes to Chat Events.
 
Subscribe (int, string, Sansar.Script.SessionId, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.
 
Subscribe (int, string, Sansar.Script.SessionId, Sansar.Script.ScriptId, Chat.SubscriptionHandler, bool)
Subscribes to Chat Events.
 
Subscribe (int, string, Sansar.Script.SessionId, Sansar.Script.ScriptId, Action<ChatData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Chat Events.

Member Details

AllChannels Field

Use as the channel argument for Chat.Subscribe(int, string, Action<Sansar.Simulation.ChatData>,System.Boolean) to subscribe to all channels.

Syntax

[Sansar.Script.Interface]
[System.Obsolete("All channel subscription no longer allowed", false)]
public static readonly int AllChannels

Remarks

No longer in use, now the same behavior as DefaultChannel

Requirements

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

DefaultChannel Field

Use as the channel argument for Chat.Subscribe(int, string, Action<Sansar.Simulation.ChatData>,System.Boolean) to subscribe to the default channel

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

Messages may be throttled.

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, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

message
The message to send.
handler
Handler to be called when the event completes.

Remarks

Messages may be throttled.

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

[Sansar.Script.Interface]
public void MessageScript (string message, Sansar.Script.ScriptId scriptId, int channel)

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

Only the script with the matching id will receive the message.

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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (Sansar.Script.ScriptId SourceScriptId, Action<ChatData> callback, bool persistent)

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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (Sansar.Script.SessionId SourceId, Action<ChatData> callback, bool persistent)

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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (int Channel, Action<ChatData> callback, bool persistent)

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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (string Source, Action<ChatData> callback, bool persistent)

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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (int Channel, Sansar.Script.ScriptId SourceScriptId, Action<ChatData> callback, bool persistent)

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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (int Channel, Sansar.Script.SessionId SourceId, Action<ChatData> callback, bool persistent)

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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (int Channel, string Source, Action<ChatData> callback, bool persistent)

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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (string Source, Sansar.Script.ScriptId SourceScriptId, Action<ChatData> callback, bool persistent)

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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (string Source, Sansar.Script.SessionId SourceId, Action<ChatData> callback, bool persistent)

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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (int Channel, string Source, Sansar.Script.ScriptId SourceScriptId, Action<ChatData> callback, bool persistent)

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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (int Channel, string Source, Sansar.Script.SessionId SourceId, Action<ChatData> callback, bool persistent)

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

[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, 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.
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

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (int Channel, string Source, Sansar.Script.SessionId SourceId, Sansar.Script.ScriptId SourceScriptId, Action<ChatData> callback, bool persistent)

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


Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.