summaryrefslogtreecommitdiff
path: root/test-client
diff options
context:
space:
mode:
Diffstat (limited to 'test-client')
-rw-r--r--test-client/main.ts3
-rw-r--r--test-client/protocol.ts1
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 }