Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PlayerTrackerClient

An extended Client class that provides player tracking functionality by exposing a players array and an event emitter for enter and leave events.

Hierarchy

Index

Constructors

constructor

Properties

account

account: Account

Information about this client's account.

Private emitter

emitter: EventEmitter

io

io: PacketIO

The packet interface for this client.

map

map: MapInfo

The map which the client is currently connected to, or undefined if the client is not connected.

objectId

objectId: number

The object id of this client when connected, and undefined if the client is not connected.

players

players: PlayerData[]

An array of all players which are visible to the client.

position

position: WorldPosData

The current position of this client when connected, and undefined if the client is not connected

proxy

proxy: Proxy

A proxy to route game traffic through.

stats

stats: PlayerData

The stat data of this client when it is connected, and undefined if the client is not connected.

Accessors

connected

  • get connected(): boolean

lastServer

time

  • get time(): number

Methods

attach

  • attach(socket: Socket): void

connect

detach

  • detach(): void

disconnect

  • disconnect(): Promise<void>

on

  • on(event: "enter" | "leave", listener: function): this
  • Parameters

    • event: "enter" | "leave"
    • listener: function
        • (player: PlayerData): void
        • Parameters

          • player: PlayerData

          Returns void

    Returns this

once

  • once(event: "enter" | "leave", listener: function): this
  • Parameters

    • event: "enter" | "leave"
    • listener: function
        • (player: PlayerData): void
        • Parameters

          • player: PlayerData

          Returns void

    Returns this

removeListener

  • removeListener(event: "enter" | "leave", listener: function): this
  • Parameters

    • event: "enter" | "leave"
    • listener: function
        • (player: PlayerData): void
        • Parameters

          • player: PlayerData

          Returns void

    Returns this

Generated using TypeDoc