Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseClientState

Hierarchy

  • BaseClientState

Index

Constructors

constructor

  • Parameters

    • handle: any
    • logger: any

    Returns BaseClientState

Methods

getId

  • getId(): any
  • Returns the states id

    Returns any

handleClose

  • handleClose(): this
  • Handles a connection close, override to add logic

    Returns this

handlePacket

  • handlePacket(packet: any): this
  • Handles a packet, override to add logic

    Parameters

    • packet: any

    Returns this

sendPacket

  • sendPacket(packet: any): void
  • Sends a packet out to the client

    Parameters

    • packet: any

    Returns void

transferState

  • Internal method to transfer to a new state, use in the handleXXX() methods

    Parameters

    • stateId: any

    Returns BaseClientState

unexpectedPacket

  • unexpectedPacket(packet: any): this
  • Helper method to indicate that a packet was not expected

    Parameters

    • packet: any

    Returns this

Static getId

  • getId(): string
  • Returns the states id, must get overriden

    Returns string