From 1cb35341481cb76feb5bb794a304d1c4e3c7b372 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 15 Aug 2024 21:17:23 +0200 Subject: message timeout replaces persist --- test-client/protocol.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test-client/protocol.ts') diff --git a/test-client/protocol.ts b/test-client/protocol.ts index d5ce67ff..40532c08 100644 --- a/test-client/protocol.ts +++ b/test-client/protocol.ts @@ -40,7 +40,7 @@ export type PacketS = | { type: "leave", player: PlayerID } // Despawns a character | { type: "movement", player: PlayerID, pos: Vec2, dir: Vec2, boost: boolean } | { type: "interact", player: PlayerID, pos?: Vec2 } // Interact with some tile. pos is a position when pressing and null when releasing interact button - | { type: "communicate", player: PlayerID, message?: Message, persist: boolean } // Send a message + | { type: "communicate", player: PlayerID, message?: Message, timeout?: number } // Send a message | { type: "replay_tick", dt: number } // Steps forward in replay. export type PacketC = @@ -55,7 +55,7 @@ export type PacketC = | { type: "set_item", location: ItemLocation, item?: ItemIndex } // the item contained in a tile or player changed | { type: "set_progress", item: ItemLocation, progress?: number, warn: boolean } // A tile is doing something. progress goes from 0 to 1, then null when finished | { type: "update_map", tile: Vec2, kind: TileIndex | null, neighbors: [TileIndex | null] } // A map tile was changed - | { type: "communicate", player: PlayerID, message?: Message, persist: boolean } // A player wants to communicate something, message is null when cleared + | { type: "communicate", player: PlayerID, message?: Message, timeout?: MessageTimeout } // A player wants to communicate something, message is null when cleared | { type: "server_message", text: string } // Text message from the server | { type: "score" } & Score // Supplies information for score OSD | { type: "menu" } & Menu // Open a menu on the client-side @@ -67,6 +67,11 @@ export type Menu = { menu: "book" } | { menu: "score", data: Score } +export interface MessageTimeout { + initial: number, + remaining: number +} + export interface Score { points: number, demands_failed: number, -- cgit v1.2.3-70-g09d2