Skip to content

Get Sansar

Script API

AgentPublic

Where: Client
More page actions

For the complete documentation index, see llms.txt. This page is also available as Markdown.

The AgentPublic class is a more limited subset of the AgentPrivate API for use by other scripts in the scene.

public class AgentPublic : Sansar.Script.InstanceInterface

Remarks

AgentPublic has a more limited API than AgentPrivate. Agents may leave the scene at any time. Attempting to use an AgentPublic interface for an agent no longer in the scene will throw a NullReferenceException.

Members at a glance

KindMembers
PropertiesAgentInfo
MethodsSendChat · ToString

Properties

AgentInfo

public AgentInfo AgentInfo { get; }

Returns the AgentInfo for this instance.

Value: AgentInfo — The AgentInfo for this instance

Remarks

The AgentInfo holds information about an agent.

Methods

SendChat

public void SendChat(string message)

Sends a String message to the $className$.

ParameterTypeDescription
messagestringThe message to send.

Throws NullReferenceException: If the user is no longer online.

Throws ThrottleException: If the throttle rate is exceeded.

Remarks

eprecated. Use AgentPrivate.SendChat or AgentPublic.SendChat

public void SendChat(     string message,     Action<Sansar.Script.OperationCompleteEvent> handler )

Sends a String message to the AgentPublic.

ParameterTypeDescription
messagestringThe message to send.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

Messages may be throttled and ignored.

ToString

public override string ToString()

A string representation of this object.

Returns: string — A string representation of this object.

Remarks

The format of this string may change between releases.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.