diff options
| author | metamuffin <metamuffin@disroot.org> | 2024-06-26 00:51:58 +0200 | 
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-06-26 00:51:58 +0200 | 
| commit | 6b40114823cac61a92756af55e06a645a3847426 (patch) | |
| tree | fa697466770fed2e32b1526a4165ad0bbfe60f80 | |
| parent | 6da91829db06cfc319b614c5f8a238c049ff94c8 (diff) | |
| download | hurrycurry-6b40114823cac61a92756af55e06a645a3847426.tar hurrycurry-6b40114823cac61a92756af55e06a645a3847426.tar.bz2 hurrycurry-6b40114823cac61a92756af55e06a645a3847426.tar.zst | |
clear message
| -rw-r--r-- | test-client/main.ts | 1 | ||||
| -rw-r--r-- | test-client/protocol.ts | 2 | 
2 files changed, 2 insertions, 1 deletions
| diff --git a/test-client/main.ts b/test-client/main.ts index 0f841b06..04cd2331 100644 --- a/test-client/main.ts +++ b/test-client/main.ts @@ -214,6 +214,7 @@ function close_chat() {  function toggle_chat() {      if (chat) {          if (chat.value.length) send({ type: "communicate", message: { text: chat.value } }) +        else send({ type: "communicate" })          chat.remove()          canvas.focus()          chat = null; diff --git a/test-client/protocol.ts b/test-client/protocol.ts index f4ffba01..9a78f263 100644 --- a/test-client/protocol.ts +++ b/test-client/protocol.ts @@ -32,7 +32,7 @@ export type PacketS =      { type: "join", name: string, character: number } // You join, sent as first packet.      | { type: "position", pos: Vec2, rot: number } // Update your position and rotation in radians (0 is -y)      | { type: "interact", pos: Vec2, edge: boolean } // Interact with some tile. edge is true when pressing and false when releasing interact button -    | { type: "communicate", message: Message } // Send a message +    | { type: "communicate", message?: Message } // Send a message      | { type: "collide", player: PlayerID, force: Vec2 } // Apply force to another player as a result of a collision  export type PacketC = | 
