dot big bang

Developer API
Menu

Class User

All
  • Public
  • Public/Protected
  • All

Hierarchy

  • User

Index

Accessors

handle

  • get handle(): string
  • The handle of the User, or the empty string if the User isn't logged-in. The handle is a word with up to 16 characters. It can contain letters (upper and lower case), digits plus hyphen and underscore. Like the id, the handle is unique across all existing Users, there can't be two Users with the same handle.

    Returns string

id

  • get id(): string
  • The identifier string of the User, or the empty string if the User isn't logged-in. The id is unique across all existing Users, there can't be two Users with the same id.

    Returns string

isFriend

  • get isFriend(): boolean
  • Indicates whether this User is a friend of the local User. The local User isn't considered friend with themselves (i.e this.localPeer.user.isFriend is false). Note that you can get the full list of the local user's friends with this.localPeer.user.friends.

    Returns boolean

isLocal

  • get isLocal(): false
  • Indicates whether this User is the one on the local client/machine (i.e. this.game.session.localPeer). When this is true, the user is actually a LocalUser that provides extra information sucha as their friend list.

    Returns false

isLoggedIn

  • get isLoggedIn(): boolean
  • Indicates whether the User has a dbb account and is logged-in.

    Returns boolean

peer

  • get peer(): LocalPeer | Peer
  • deprecated

    Gets the first Peer this User is associated to. Please use peers instead.

    Returns LocalPeer | Peer

peers

  • get peers(): (LocalPeer | Peer)[]
  • Gets the Peer(s) this User is associated to. The same logged-in User can be participating to the multiplayer game by opening multiple browser tabs on the game or using multiple devices, each of these is represented a different Peer. Non-logged in users are not identifiable and therefore are systematically associated with a singe Peer.

    Returns (LocalPeer | Peer)[]