Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ServerUtils

Index

Constructors

constructor

  • new ServerUtils(settings?: Partial<ServerUtilSettings>): ServerUtils

Properties

Private Readonly _utilSettings

_utilSettings: ServerUtilSettings = ...

Methods

callClientRPC

  • callClientRPC<T>(eventName: string, src: string | number, data?: unknown): Promise<T>
  • For calling RPC events registered on the client. RPC events will trigger on the client and return client data which is dependent on the logic of the RPC callback.

    Type parameters

    • T = any

    Parameters

    • eventName: string

      The event name to trigger

    • src: string | number

      The source of the player to call the RPC event on

    • Optional data: unknown

      Any data you wish to pass to the client during this RPC request

    Returns Promise<T>

Private debugLog

  • debugLog(...args: unknown[]): void

onNetPromise

  • onNetPromise<T, P>(eventName: string, cb: CBSignature<T, P>): void
  • The method used whenever handling a promisified event sent by the Client Utils instance

    Type parameters

    • T = any

    • P = any

    Parameters

    • eventName: string

      The event name to listen for

    • cb: CBSignature<T, P>

      A callback function that takes the req and resp objects as its arguments

    Returns void

Generated using TypeDoc