Functions
Every function the generated library exposes on the global
Gamehoster object, grouped into namespaces. Pick one to see its calls in full.
Provisional: this tracks the frontend API as it settles.
Namespaces
Conventions
The functions share a few shapes so they behave predictably. Nearly every call returns a
handle object: you set its handlers as fields and call cancel() to stop,
the same idea as WebSocket or XMLHttpRequest. There are two kinds, plus one
deliberate exception.
| Kind | Fields | Used by |
|---|---|---|
| Subscription handle: a live value that changes over time | onChange(value), onError(err), cancel() |
Browse.Instances, Instance.State,
Instance.Frame |
| Operation handle: a one-shot action that completes once | onSuccess(value), onError(err), cancel() |
Instance.Join.*, Create, Instance.Leave |
| Fire-and-forget: a player's input or command | returns nothing | Instance.Send |
- A subscription's
onChangefires once immediately with the current value, then again on every change, until youcancel(). - An operation settles once (
onSuccessoronError) andcancel()abandons it if it's slow. - Send is fire-and-forget because inputs fly many times a second; you observe a
command's effect through
Instance.StateorInstance.Frame, not a per-call handle.