widgrensitasobi-defold
widgrensit/asobi-defold/asobi.api.matchmaker
The asobi matchmaker over REST. A project reaches it as client.matchmaker.
- 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_matchmaker from "asobi.api.matchmaker"
- Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged
Functions
add(client: Client, opts?: string | MatchmakerTicket, callback?: HttpCallback)
Queues the signed-in player for a match.
Parameters
client:Client— The client.opts?:string | MatchmakerTicket— The mode to queue for, or the ticket. Queues for"default"when left out.callback?:HttpCallback— Receives the ticket, or the error.
status(client: Client, ticket_id: string, callback?: HttpCallback)
Fetches a ticket's state.
Parameters
client:Client— The client.ticket_id:string— The ticket's id.callback?:HttpCallback— Receives the ticket, or the error.
cancel(client: Client, ticket_id: string, callback?: HttpCallback)
Leaves the queue.
Parameters
client:Client— The client.ticket_id:string— The ticket's id.callback?:HttpCallback— Receives the server's answer, or the error.
Types
MatchmakerTicket
MatchmakerTicket.mode?: string
The mode to queue for. Defaults to "default".
MatchmakerTicket.properties?: Payload
The properties the server matches players on.