On this page

Insality/defold-proto/proto.proto

Protocol-buffer style message encoding for compact Defold network payloads.

  • GitHub: Insality/defold-proto — pinned to 2fe3aed
    1. Pick a release from Insality/defold-proto releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as proto from "proto.proto"

Functions

init(configOrPath: string | { [key: string]: string; })

Parameters

  • configOrPath: string | { [key: string]: string; }

get(protoType: string): { [key: string]: unknown; }

Parameters

  • protoType: string

Returns

  • { [key: string]: unknown; }

encode(protoType: string, data: { [key: string]: any; }): string

Parameters

  • protoType: string
  • data: { [key: string]: any; }

Returns

  • string

decode(protoType: string, data?: string): { [key: string]: unknown; }

Parameters

  • protoType: string
  • data?: string

Returns

  • { [key: string]: unknown; }

verify(protoType: string, data: { [key: string]: any; }): { [key: string]: unknown; }

Parameters

  • protoType: string
  • data: { [key: string]: any; }

Returns

  • { [key: string]: unknown; }

set_logger(logger_instance: LoggerInstance)

Parameters

  • logger_instance: LoggerInstance

set_logger(remove_logger_instance: undefined)

Parameters

  • remove_logger_instance: undefined

Types

LoggerInstance.trace(this: any, message: string, data?: {})

Parameters

  • this: any
  • message: string
  • data?: {}

LoggerInstance.debug(this: any, message: string, data?: {})

Parameters

  • this: any
  • message: string
  • data?: {}

LoggerInstance.info(this: any, message: string, data?: {})

Parameters

  • this: any
  • message: string
  • data?: {}

LoggerInstance.warn(this: any, message: string, data?: {})

Parameters

  • this: any
  • message: string
  • data?: {}

LoggerInstance.error(this: any, message: string, data?: {})

Parameters

  • this: any
  • message: string
  • data?: {}