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- Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as api_worlds from "asobi.api.worlds"
- Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged
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.