Skip to content

Get Sansar

Script API

User

Where: Client
More page actions

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

The User class handles interactions user logins and logoffs.

public class User : Sansar.Script.InstanceInterface

Members at a glance

KindMembers
FieldsAddUser · RemoveUser
MethodsSubscribe

Fields

AddUser

public static readonly string AddUser

For subscribing to events for users entering the scene

RemoveUser

public static readonly string RemoveUser

For subscribing to events for users leaving the scene

Methods

Subscribe

Deprecated
[System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.UserData>", false)] public void Subscribe(     string Action,     User.SubscriptionHandler callback,     bool persistent )

Subscribes to User Events.

ParameterTypeDescription
Actionstringstring action of the event: AddUser, RemoveUser
callbackUser.SubscriptionHandlerCallback which is executed when the event completes.
persistentboolOptional, set to false to unsubscribe after one event.
public Sansar.Script.IEventSubscription Subscribe(     string Action,     Action<UserData> callback,     bool persistent )

Subscribes to User Events.

ParameterTypeDescription
Actionstringstring action of the event: AddUser, RemoveUser
callbackAction<UserData>Callback which is executed when the event completes.
persistentboolOptional, set to false to unsubscribe after one event.

Returns: Sansar.Script.IEventSubscription — An IEventSubscription that can be used to cancel the subscription.

Deprecated
[System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.UserData>", false)] public void Subscribe(     string Action,     Sansar.Script.SessionId User,     User.SubscriptionHandler callback,     bool persistent )

Subscribes to User Events.

ParameterTypeDescription
Actionstringstring action of the event: AddUser, RemoveUser
UserSansar.Script.SessionIdSansar.Script.SessionId for the user.
callbackUser.SubscriptionHandlerCallback which is executed when the event completes.
persistentboolOptional, set to false to unsubscribe after one event.
public Sansar.Script.IEventSubscription Subscribe(     string Action,     Sansar.Script.SessionId User,     Action<UserData> callback,     bool persistent )

Subscribes to User Events.

ParameterTypeDescription
Actionstringstring action of the event: AddUser, RemoveUser
UserSansar.Script.SessionIdSansar.Script.SessionId for the user.
callbackAction<UserData>Callback which is executed when the event completes.
persistentboolOptional, set to false to unsubscribe after one event.

Returns: Sansar.Script.IEventSubscription — An IEventSubscription that can be used to cancel the subscription.

Used in examples

…and 14 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.