Skip to content

GameHostMessage beta ​

TypeAlias of @v12-engine/engine

ts
export type GameHostMessage = {
    type: 'welcome';
    protocol: number;
    player: PlayerId;
    tickRate: number;
    game: string;
    hash: string;
    terrain: SavedGround;
    environment?: MapEnvironment;
    doodads?: MapDoodad[];
    regions?: MapRegion[];
    cameras?: MapCamera[];
    paths?: MapPath[];
    redefinitions?: GameData;
    first: Delta;
    observer?: boolean;
    debug?: true;
} | {
    type: 'pong';
    at: number;
}
/** A part of the ground a world started as, for a player who does not have its map: `text` of `parts`, joined, is a `TerrainSave` */
 | {
    type: 'ground';
    part: number;
    parts: number;
    text: string;
}
/** The game ended on an error in its rules (`World.failure`): what the players are told of it */
 | {
    type: 'failed';
    message: string;
} | ({
    type: 'delta';
} & Delta)
/** The debug tools' view of the world (`SessionDebug`), for a player who may use them and follows something: every tenth of a second */
 | {
    type: 'debug';
    inspection: Inspection | null;
    world: WorldListing | null;
    log: readonly LoggedEvent[];
};

What the host sends a player