From 031584df60e10c4013e679bebfaaafbe33acf58e Mon Sep 17 00:00:00 2001 From: "Flemming N. Larsen" Date: Wed, 21 Aug 2024 00:17:24 +0200 Subject: [PATCH] #101: The `ServerHandshake` now includes the `GameSetup` containing information about the current game setup. --- VERSIONS.MD | 9 ++++++++- schema/schemas/server-handshake.yaml | 3 +++ .../server/connection/ClientWebSocketsHandler.kt | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/VERSIONS.MD b/VERSIONS.MD index 875400f40..3896a588f 100644 --- a/VERSIONS.MD +++ b/VERSIONS.MD @@ -1,3 +1,10 @@ +## 📦 0.24.2 + +#### 🚀 Improvements + +- Server: + - #101: The `ServerHandshake` now includes the `GameSetup` containing information about the current game setup. + ## 📦 0.24.1 - Support for local IP addresses - 13-Jul-2024 #### 🚀 Improvements @@ -27,7 +34,7 @@ - Java archive (jar) files: - The jar files containing javadoc documentation and source files was not given the correct name when they were built and published to the repositories. - + ## 📦 0.23.2 - Bug fixed booting + enabling/disabling bot directories - 21-May-2024 #### 🪲 Bug Fixes diff --git a/schema/schemas/server-handshake.yaml b/schema/schemas/server-handshake.yaml index 9c22d7bd7..3cc05da8b 100644 --- a/schema/schemas/server-handshake.yaml +++ b/schema/schemas/server-handshake.yaml @@ -23,6 +23,9 @@ properties: type: string minItems: 1 uniqueItems: true + gameSetup: + description: Current game setup, if a game has been started and is running on the server. + $ref: game-setup.yaml required: - sessionId - variant diff --git a/server/src/main/kotlin/dev/robocode/tankroyale/server/connection/ClientWebSocketsHandler.kt b/server/src/main/kotlin/dev/robocode/tankroyale/server/connection/ClientWebSocketsHandler.kt index c87c1566a..88bbbb072 100644 --- a/server/src/main/kotlin/dev/robocode/tankroyale/server/connection/ClientWebSocketsHandler.kt +++ b/server/src/main/kotlin/dev/robocode/tankroyale/server/connection/ClientWebSocketsHandler.kt @@ -82,6 +82,7 @@ class ClientWebSocketsHandler( variant = "Tank Royale" version = VersionFileProvider.version gameTypes = setup.gameTypes + gameSetup = gameSetup }.also { send(clientSocket, Gson().toJson(it)) }