Options
All
  • Public
  • Public/Protected
  • All
Menu

The client-side User document which extends the common BaseUser model. Each User document contains UserData which defines its data schema.

mixes

ClientDocumentMixin

see

{@link documents.Users} The world-level collection of User documents

see

{@link applications.UserConfig} The User configuration application

Hierarchy

  • any
    • User

Index

Constructors

  • Returns User

Properties

active: boolean = false

Track whether the user is currently active in the game

targets: Set<Token> = ...

Track references to the current set of Tokens which are targeted by the User

viewedScene: string = null

Track the ID of the Scene that is currently being viewed by the User

avatar: any
border: utils.Color

Accessors

  • get isTrusted(): boolean
  • A flag for whether the current User is a Trusted Player

    Returns boolean

  • get isSelf(): boolean
  • A flag for whether this User is the connected client

    Returns boolean

Methods

  • prepareDerivedData(): void
  • inheritdoc

    Returns void

  • assignHotbarMacro(macro: Macro, slot: string | number, [fromSlot]?: number): Promise<User>
  • Assign a Macro to a numbered hotbar slot between 1 and 50

    Parameters

    • macro: Macro

      The Macro document to assign

    • slot: string | number
    • [fromSlot]: number = {}

      An optional origin slot from which the Macro is being shifted

    Returns Promise<User>

    A Promise which resolves once the User update is complete

  • assignPermission(permission: string, allowed: boolean): any
  • Assign a specific boolean permission to this user. Modifies the user permissions to grant or restrict access to a feature.

    Parameters

    • permission: string

      The permission name from USER_PERMISSIONS

    • allowed: boolean

      Whether to allow or restrict the permission

    Returns any

  • broadcastActivity(activityData?: ActivityData, [options]?: { volatile: boolean }): void
  • Submit User activity data to the server for broadcast to other players. This type of data is transient, persisting only for the duration of the session and not saved to any database. Activity data uses a volatile event to prevent unnecessary buffering if the client temporarily loses connection.

    Parameters

    • activityData: ActivityData = {}

      An object of User activity data to submit to the server for broadcast.

    • [options]: { volatile: boolean } = {}
      • volatile: boolean

    Returns void

  • getHotbarMacros(page?: number): { slot: number; macro: Macro }[]
  • Get an Array of Macro Documents on this User's Hotbar by page

    Parameters

    • page: number = 1

      The hotbar page number

    Returns { slot: number; macro: Macro }[]

    }

  • updateTokenTargets(targetIds?: string[]): void
  • Update the set of Token targets for the user given an array of provided Token ids.

    Parameters

    • targetIds: string[] = []

      An array of Token ids which represents the new target set

    Returns void

  • _onUpdate(data: any, options: any, userId: any): any
  • inheritdoc

    Parameters

    • data: any
    • options: any
    • userId: any

    Returns any

  • _onDelete(options: any, userId: any): void
  • inheritdoc

    Parameters

    • options: any
    • userId: any

    Returns void