Options
All
  • Public
  • Public/Protected
  • All
Menu

Module cadre

Utility functions for cadre.

Index

Type aliases

AliasEvent

AliasEvent: Event<"alias", string>

Sent from the client when they want to know the game name for a given string game alias.

ClientEvent

One of the possible events that a client can send to its server.

DeltaEvent

DeltaEvent: Event<"delta", Delta["game"]>

Triggers after serialized game logic finished and the game state changed in some way. The partial game delta is sent, in delta merge format.

FatalEvent

FatalEvent: Event<"fatal", { message?: undefined | string; timedOut?: undefined | false | true }>

Sent to clients when something happens that is so bad, they must be forcefully disconnected. For the "fatal" event.

FinishedEvent

FinishedEvent: Event<"finished", { orderIndex: number; returned: unknown }>

Sent from the client when they "finished" an order.

InvalidEvent

InvalidEvent: Event<"invalid", { data?: unknown; message: string }>

Sent to clients when something they send gameplay wise is invalid. For the "invalid" event.

LobbiedEvent

LobbiedEvent: Event<"lobbied", { constants: DeltaMergeConstants; gameName: string; gameSession: string; gameVersion: string }>

Send from the server to a client once they are in a game lobby, but before a game starts.

MetaDeltaEvent

MetaDeltaEvent: Event<"meta-delta", Delta>

The same as a normal delta event, but the data is the entire delta, instead of just the game state. Intended for spectators who want the entire gamelog instead just game data.

NamedEvent

NamedEvent: Event<"named", string>

Sent from the game server to a single client once a game alias has been "named" to it's game name (id).

OrderEvent

OrderEvent: Event<"order", { args: Array<unknown>; index: number; name: string }>

Sent to clients when they need to run an order (function). For the "order" event.

OverEvent

OverEvent: Event<"over", { gamelogURL: string; message?: undefined | string; visualizerURL?: undefined | string }>

Sent from the server to clients when the game is over.

This is always the final event in a normal game.

PlayEvent

PlayEvent: Event<"play", { clientType: string; gameName: string; gameSettings?: string | null; metaDeltas?: boolean | null; password?: string | null; playerIndex?: number | null; playerName?: string | null; requestedSession?: string | null; spectating?: boolean | null }>

Sent from a client to the Lobby about what that client wants to play.

All optional keys can be null or undefined for an "unset" value.

RanEvent

RanEvent: Event<"ran", unknown>

Returned to a client once some game logic has ben "ran" for it. The data is the return value of that run event sent.

RunEvent

RunEvent: Event<"run", { args: {}; caller: GameObjectReference; functionName: string }>

Sent from the client when they want the game server to "run" logic.

ServerEvent

A possible event sent from the server to client(s).

StartEvent

StartEvent: Event<"start", { playerID?: undefined | string }>

Sent to clients when the game has started. For the "start" event. Always sent after "lobbied".

Generated using TypeDoc