From f61c3b437e5d6f3f32ec558576aa656aaa7dae5e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 11 Jul 2024 15:27:49 +0200 Subject: send protocol version --- test-client/protocol.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test-client/protocol.ts') 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 -- cgit v1.2.3-70-g09d2