summaryrefslogtreecommitdiff
path: root/test-client/protocol.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-17 00:30:38 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-17 00:30:38 +0200
commite37231630488e5b54741d68edc45890a62c5610d (patch)
tree8be6237564176635a7f5d323d1fb5e417f9b8119 /test-client/protocol.ts
parentdd4b88a86a99f028bdfe66fef3c66170629f3cdc (diff)
downloadhurrycurry-e37231630488e5b54741d68edc45890a62c5610d.tar
hurrycurry-e37231630488e5b54741d68edc45890a62c5610d.tar.bz2
hurrycurry-e37231630488e5b54741d68edc45890a62c5610d.tar.zst
client connects and can speak proto
Diffstat (limited to 'test-client/protocol.ts')
-rw-r--r--test-client/protocol.ts24
1 files changed, 22 insertions, 2 deletions
diff --git a/test-client/protocol.ts b/test-client/protocol.ts
index 9761f152..3b61ce94 100644
--- a/test-client/protocol.ts
+++ b/test-client/protocol.ts
@@ -1,4 +1,24 @@
+export type ID = number;
+export type Vec2 = [number, number]
+export type Item = string
+export type Tile = string
+export type PacketS =
+ { join: { name: string } }
+ | "leave"
+ | { position: { pos: Vec2, rot: number } }
+ | { interact: { pos: Vec2 } }
+
+
+export type PacketC =
+ { joined: { id: ID } }
+ | { add_player: { id: ID, name: string } }
+ | { remove_player: { id: ID } }
+ | { position: { player: ID, pos: Vec2, rot: number } }
+ | { take_item: { item: ID, player: ID } }
+ | { put_item: { item: ID, pos: Vec2 } }
+ | { produce_item: { id: ID, pos: Vec2, kind: Item } }
+ | { consume_item: { id: ID, pos: Vec2 } }
+ | { set_active: { tile: Vec2 } }
+ | { update_map: { pos: Vec2, tile: Tile } }
-export type PacketS = {}
-export type PacketC = {}