diff options
| author | metamuffin <metamuffin@disroot.org> | 2024-06-23 15:14:42 +0200 | 
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-06-23 19:32:56 +0200 | 
| commit | d55a419ed26db4213b18424fbaae7fff182eb2ae (patch) | |
| tree | 04b28a6f7c5646053df5fcf5c20dcb7babf11cfa /test-client | |
| parent | 50ea7e15d0a6185d9114cf9ac8337c3558334fd4 (diff) | |
| download | hurrycurry-d55a419ed26db4213b18424fbaae7fff182eb2ae.tar hurrycurry-d55a419ed26db4213b18424fbaae7fff182eb2ae.tar.bz2 hurrycurry-d55a419ed26db4213b18424fbaae7fff182eb2ae.tar.zst | |
report errors to client
Diffstat (limited to 'test-client')
| -rw-r--r-- | test-client/main.ts | 3 | ||||
| -rw-r--r-- | test-client/protocol.ts | 1 | 
2 files changed, 4 insertions, 0 deletions
| diff --git a/test-client/main.ts b/test-client/main.ts index cdef5a91..80b68906 100644 --- a/test-client/main.ts +++ b/test-client/main.ts @@ -163,6 +163,9 @@ function packet(p: PacketC) {              else player.message = undefined              break;          } +        case "error": +            console.warn(p.message) +            break;          default:              console.warn("unknown packet", p);      } diff --git a/test-client/protocol.ts b/test-client/protocol.ts index 145e08fe..68307a1f 100644 --- a/test-client/protocol.ts +++ b/test-client/protocol.ts @@ -29,6 +29,7 @@ export type PacketC =      | { type: "set_active", tile: Vec2, progress?: number, warn: boolean } // A tile is doing something. progress goes from 0 to 1, then null when finished      | { type: "update_map", pos: Vec2, tile: TileIndex, neighbors: [TileIndex | null] } // A map tile was changed      | { type: "communicate", player: PlayerID, message?: Message } // A player wants to communicate something, message is null when cleared +    | { type: "error", message?: Message } // Your client did something wrong.  export type Message =      { item: number } | 
