megalanthusdefold-gamepush
megalanthus/defold-gamepush/gamepush.core.events
GamePush events: list them, join one and check whether it is active, with their events.
- GitHub: megalanthus/defold-gamepush — pinned to
v1.4.1- Pick a release from megalanthus/defold-gamepush 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 core_events from "gamepush.core.events"
- Pick a release from megalanthus/defold-gamepush releases and add its Source code (zip) URL (or a packaged
Functions
join(parameters: Record<string, unknown>, callback?: (result: unknown) => void)list(): Record<string, unknown>[]active_list(): Record<string, unknown>[]get_event(id_or_tag: string | number): Record<string, unknown>has(id_or_tag: string | number): booleanis_joined(id_or_tag: string | number): boolean
join(parameters: Record<string, unknown>, callback?: (result: unknown) => void)
Joins an event. Raises when the table is missing.
Parameters
parameters:Record<string, unknown>— The options for the SDK'sevents.join.callback?:(result: unknown) => void— Receives the result.
list(): Record<string, unknown>[]
All events.
Returns
Record<string, unknown>[]
active_list(): Record<string, unknown>[]
The events the player is taking part in.
Returns
Record<string, unknown>[]
get_event(id_or_tag: string | number): Record<string, unknown>
An event's description.
Parameters
id_or_tag:string | number— The event's id or tag.
Returns
Record<string, unknown>
has(id_or_tag: string | number): boolean
Whether an event is active.
Parameters
id_or_tag:string | number— The event's id or tag.
Returns
boolean
is_joined(id_or_tag: string | number): boolean
Whether the player is taking part in an event.
Parameters
id_or_tag:string | number— The event's id or tag.
Returns
boolean
Variables
callbacks: EventsCallbacks
The event handlers.
Types
EventsCallbacks
EventsCallbacks.join?: (event: unknown) => void
The player joined an event.
EventsCallbacks.error_join?: (error: unknown) => void
Joining an event failed.