diff options
author | metamuffin <metamuffin@disroot.org> | 2024-08-15 21:17:23 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-08-15 21:17:23 +0200 |
commit | 1cb35341481cb76feb5bb794a304d1c4e3c7b372 (patch) | |
tree | dcd65f95aaa2805c14f83125ceb1bf11b6bf47be /test-client/protocol.ts | |
parent | a868f49b41c30daca83de86f982ffed431d3e891 (diff) | |
download | hurrycurry-1cb35341481cb76feb5bb794a304d1c4e3c7b372.tar hurrycurry-1cb35341481cb76feb5bb794a304d1c4e3c7b372.tar.bz2 hurrycurry-1cb35341481cb76feb5bb794a304d1c4e3c7b372.tar.zst |
message timeout replaces persist
Diffstat (limited to 'test-client/protocol.ts')
-rw-r--r-- | test-client/protocol.ts | 9 |
1 files changed, 7 insertions, 2 deletions
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, |