Class Extension

Hierarchy

  • Extension

Constructors

Methods

  • Get the packet info manager

    Returns undefined | PacketInfoManager

  • Register a listener on a all packet types

    Parameters

    • direction: HDirection

      ToClient or ToServer

    • messageListener: ((hMessage) => void)

      The callback

        • (hMessage): void
        • Parameters

          Returns void

    Returns void

  • Register a listener on a specific packet type by header ID

    Parameters

    • direction: HDirection

      ToClient or ToServer

    • headerId: number

      The packet header ID

    • messageListener: ((hMessage) => void)

      The callback

        • (hMessage): void
        • Parameters

          Returns void

    Returns void

  • Register a listener on a specific packet type by name or hash

    Parameters

    • direction: HDirection

      ToClient or ToServer

    • headerNameOrHash: string | String

      The packet name or hash

    • messageListener: ((hMessage) => void)

      The callback

        • (hMessage): void
        • Parameters

          Returns void

    Returns void

  • Listen for an event

    Parameters

    • event: string

      Valid events: init, click, start, end, connect

    • listener: ((...args) => void)

      Do on event

        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Extension

  • Listen for extension initialization

    Parameters

    • event: "init"

      Extension initialized

    • listener: (() => void)

      Do on initialization

        • (): void
        • Returns void

    Returns Extension

  • Listen for click on button in G-Earth Extensions tab

    Parameters

    • event: "click"

      G-Earth button clicked

    • listener: (() => void)

      Do on click

        • (): void
        • Returns void

    Returns Extension

  • Listen for the connection to start

    Parameters

    • event: "start"

      Connection started

    • listener: (() => void)

      Do on connection start

        • (): void
        • Returns void

    Returns Extension

  • Listen for the connection to end

    Parameters

    • event: "end"

      Connection ended

    • listener: (() => void)

      Do on connection end

        • (): void
        • Returns void

    Returns Extension

  • Listen for a connection

    Parameters

    • event: "connect"

      Connection made

    • listener: ((host, connectionPort, hotelVersion, clientIdentifier, clientType) => void)

      Do on connection made (passes parameters host, connectionPort, hotelVersion, clientIdentifier, clientType)

        • (host, connectionPort, hotelVersion, clientIdentifier, clientType): void
        • Parameters

          • host: string
          • connectionPort: number
          • hotelVersion: string
          • clientIdentifier: string
          • clientType: HClient

          Returns void

    Returns Extension

  • Listen for the socket connection to drop

    Parameters

    • event: "socketdisconnect"

      Socket connection ended

    • listener: (() => void)

      Do on socket connection end

        • (): void
        • Returns void

    Returns Extension

  • Listen for updates on host info

    Parameters

    • event: "hostinfoupdate"

      Host info updated

    • listener: ((hostInfo) => void)

      Do on host info update

        • (hostInfo): void
        • Parameters

          Returns void

    Returns Extension

  • Requests the flags which have been given to G-Earth when it got executed For example, you might want this extension to do a specific thing if the flag "-e" was given

    Parameters

    • flagRequestCallback: Function

      callback

    Returns boolean

    if the request was successful, will return false if another flag request is busy

  • Write to the console in G-Earth

    Parameters

    • s: string | String

      The text to be written

    • Optional colorClass: string

      Optional color of the text to be written (default: "black")

    Returns void

Generated using TypeDoc