summaryrefslogtreecommitdiff
path: root/test-client/protocol.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-11 15:27:49 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-11 15:27:49 +0200
commitf61c3b437e5d6f3f32ec558576aa656aaa7dae5e (patch)
tree2f63feb303404e74ed72cc225c0ebcaf41722043 /test-client/protocol.ts
parent17e7cb63bf70b35a58cf52ebea4bb543c450320f (diff)
downloadhurrycurry-f61c3b437e5d6f3f32ec558576aa656aaa7dae5e.tar
hurrycurry-f61c3b437e5d6f3f32ec558576aa656aaa7dae5e.tar.bz2
hurrycurry-f61c3b437e5d6f3f32ec558576aa656aaa7dae5e.tar.zst
send protocol version
Diffstat (limited to 'test-client/protocol.ts')
-rw-r--r--test-client/protocol.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/test-client/protocol.ts b/test-client/protocol.ts
index 10b5b2dc..2cd58f75 100644
--- a/test-client/protocol.ts
+++ b/test-client/protocol.ts
@@ -44,7 +44,8 @@ export type PacketS =
| { type: "collide", player: PlayerID, force: Vec2 } // Apply force to another player as a result of a collision
export type PacketC =
- { type: "init", id: PlayerID } // You just connected. This is your id for this session.
+ { type: "version", minor: number, major: number } // Sent once after connecting to ensure you client is compatible
+ | { type: "init", id: PlayerID } // You just connected. This is your id for this session.
| { type: "data", data: Gamedata } // Game data was changed
| { type: "add_player", id: PlayerID, name: string, position: Vec2, character: number } // Somebody else joined (or was already in the game)
| { type: "remove_player", id: PlayerID } // Somebody left