The User class handles interactions user logins and logoffs.
public class User : Sansar.Script.InstanceInterfaceMembers at a glance
| Kind | Members |
|---|---|
| Fields | AddUser · RemoveUser |
| Methods | Subscribe |
Fields
AddUser
public static readonly string AddUserFor subscribing to events for users entering the scene
RemoveUser
public static readonly string RemoveUserFor 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.
| Parameter | Type | Description |
|---|---|---|
Action | string | string action of the event: AddUser, RemoveUser |
callback | User.SubscriptionHandler | Callback which is executed when the event completes. |
persistent | bool | Optional, set to false to unsubscribe after one event. |
public Sansar.Script.IEventSubscription Subscribe(
string Action,
Action<UserData> callback,
bool persistent
)Subscribes to User Events.
| Parameter | Type | Description |
|---|---|---|
Action | string | string action of the event: AddUser, RemoveUser |
callback | Action<UserData> | Callback which is executed when the event completes. |
persistent | bool | Optional, 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.
| Parameter | Type | Description |
|---|---|---|
Action | string | string action of the event: AddUser, RemoveUser |
User | Sansar.Script.SessionId | Sansar.Script.SessionId for the user. |
callback | User.SubscriptionHandler | Callback which is executed when the event completes. |
persistent | bool | Optional, 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.
| Parameter | Type | Description |
|---|---|---|
Action | string | string action of the event: AddUser, RemoveUser |
User | Sansar.Script.SessionId | Sansar.Script.SessionId for the user. |
callback | Action<UserData> | Callback which is executed when the event completes. |
persistent | bool | Optional, 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
- StatsExample.cs
- TeleportHotkeys.cs
- VisitorTrackerExample.cs
- BanHammerExample.cs
- BroadcastUsers.cs
CameraShakeExample.cs- CastRayExample.cs
- CommandExample.cs
- CommandScreenshot.cs
- CoroutineEventExample.cs
- CoroutineExample.cs
- EventExample.cs
…and 14 more examples in the snapshot.
Generated from the Sansar 47.10.0 client ScriptApi snapshot.