Options
All
  • Public
  • Public/Protected
  • All
Menu

R stands for Register

These functions can only be called in plugins' register() function.

Index

Functions

  • Register a configuration option.

    Parameters

    • key: string

      config key

    • options: ConfigOption

      See ConfigOption

      NOTE: options.validator will only notify user about invalid value. It wouldn't stop user from saving invalid value.

    Returns void

  • Contributor(name: string, link?: string): void
  • Register a contributor.

    Contributors will show up in WebUI.

    Parameters

    • name: string

      Contributor's name

    • Optional link: string

      Contributor's homepage

    Returns void

  • DataFile(path: string, options?: FileOption): void
  • Register a data file upload entry.

    Parameters

    • path: string

      a path (with filename) where the uploaded file will be saved to.

    • Optional options: FileOption

    Returns void

  • ExtraModuleHandler(handler: (model: string) => string | string[] | Promise<string | string[]>): void
  • Register a handler for adding extra modules

    Core has the following modules built-in:

    • cardmng
    • facility
    • message
    • numbering
    • package
    • pcbevent
    • pcbtracker
    • pkglist
    • posevent
    • userdata
    • userid
    • eacoin
    • local
    • local2
    • lobby
    • lobby2
    • dlstatus
    • netlog
    • sidmgr
    • globby

    Callback can be async function if you want to use await for your DB operations.

    Parameters

    • handler: (model: string) => string | string[] | Promise<string | string[]>
        • (model: string): string | string[] | Promise<string | string[]>
        • Parameters

          • model: string

          Returns string | string[] | Promise<string | string[]>

    Returns void

  • GameCode(code: string): void
  • Register a target game code to your plugin for checking savedata.

    You should only call this from your plugin's register() function.

    Parameters

    • code: string

      Model code of your target machine, usually three capital letters

    Returns void

  • Register your custom route.

    You should only call this from your plugin's register() function.

    Parameters

    • method: string

      Method name of your target route, usually looks like "module.get"

    • handler: boolean | EamusePluginRoute

      Your custom route function/method following the type EamusePluginRoute. A boolean can be passed if you don't need any processing: - true: Sending empty response with status code 0 - false: Sending empty response with status code 1

    Returns void

  • Register all unhandled routes for a game.

    You should only call this from your plugin's register() function.

    Parameters

    • Optional handler: EamusePluginRoute

      Your custom route function/method following the type EamusePluginRoute. If undefined, the router will apply a default handler that prints method names.

    Returns void

  • Register a WebUI event callback

    Which can be called in WebUI using emit(event) function or a post message to /emit/<event>

    Callback can be async function if you want to use await for your DB operations.

    Parameters

    Returns void

Generated using TypeDoc