UNPKG

multyx

Version:

Framework designed to simplify the creation of multiplayer browser games by addressing the complexities of managing server-client communication, shared state, and input handling

50 lines 1.36 kB
import { RawObject } from "../types"; export interface EditUpdate { team: boolean; path: string[]; value: any; instruction: 'edit'; } export interface SelfUpdate { instruction: 'self'; property: 'controller' | 'uuid' | 'constraint' | 'space'; data: any; } export interface InputUpdate { instruction: 'input'; input: string; data: any; } export interface ResponseUpdate { instruction: 'resp'; name: string; response: any; } export interface ConnectionUpdate { instruction: 'conn'; uuid: string; publicData: RawObject; } export interface DisconnectUpdate { instruction: 'dcon'; clientUUID: string; } export interface InitializeUpdate { instruction: 'init'; client: RawObject; tps: number; constraintTable: RawObject; clients: RawObject; teams: RawObject; space: string; } /** * Compresses update into a string * [instruction][specifier]:[data] * @param update * @returns Compressed update */ export declare function CompressUpdate(update: Update): string | undefined; export declare function UncompressUpdate(str: string): EditUpdate | InputUpdate | ResponseUpdate | null | undefined; export type Update = EditUpdate | InputUpdate | SelfUpdate | ResponseUpdate | InitializeUpdate | ConnectionUpdate | DisconnectUpdate; //# sourceMappingURL=update.d.ts.map