Skip to Content
defold-typescript libraries
widgrensitasobi-defold

widgrensit/asobi-defold/asobi.api.worlds

asobi worlds over REST. A project reaches it as client.worlds.

  • GitHub: widgrensit/asobi-defold — pinned to v1.18.1
    1. Pick a release from widgrensit/asobi-defold 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 api_worlds from "asobi.api.worlds"

Functions

list(client: Client, opts?: string | WorldListOptions, callback?: HttpCallback)

Fetches worlds.

Parameters

  • client: Client — The client.
  • opts?: string | WorldListOptions — The mode to filter by, or the filters.
  • callback?: HttpCallback — Receives the worlds, or the error.

get(client: Client, world_id: string, callback?: HttpCallback)

Fetches one world.

Parameters

  • client: Client — The client.
  • world_id: string — The world's id.
  • callback?: HttpCallback — Receives the world, or the error.

create(client: Client, mode: string, callback?: HttpCallback)

Creates a world.

Parameters

  • client: Client — The client.
  • mode: string — The world's mode.
  • callback?: HttpCallback — Receives the world, or the error.

Types

WorldListOptions

WorldListOptions.mode?: string

Only worlds of this mode.

WorldListOptions.has_capacity?: boolean

Only worlds that have, or lack, room for another player.

On this page