From 766d3c7d4748ab023635a55dfeb94cfa6d4f6246 Mon Sep 17 00:00:00 2001 From: Snoweuph Date: Wed, 12 Mar 2025 09:53:57 +0100 Subject: [PATCH] Fix: Stop it from starting by removing old Placeholders --- .../server/channels/match/TimeMessage.java | 27 ------------------- ws/example/time_channel.sh | 17 ------------ ws/ws.yml | 25 ----------------- 3 files changed, 69 deletions(-) delete mode 100644 src/main/java/de/towerdefence/server/server/channels/match/TimeMessage.java delete mode 100755 ws/example/time_channel.sh diff --git a/src/main/java/de/towerdefence/server/server/channels/match/TimeMessage.java b/src/main/java/de/towerdefence/server/server/channels/match/TimeMessage.java deleted file mode 100644 index 6072dbd..0000000 --- a/src/main/java/de/towerdefence/server/server/channels/match/TimeMessage.java +++ /dev/null @@ -1,27 +0,0 @@ -package de.towerdefence.server.server.channels.match; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import de.towerdefence.server.server.JsonMessage; -import lombok.AllArgsConstructor; - -import java.util.Map; - -@AllArgsConstructor -public class TimeMessage extends JsonMessage { - private final long time; - private final String matchId; - - @Override - protected String getMessageId() { - return "CurrentUnixTime"; - } - - @Override - protected Map getData(JsonNodeFactory factory) { - return Map.of( - "time", factory.numberNode(this.time), - "matchId", factory.textNode(this.matchId) - ); - } -} diff --git a/ws/example/time_channel.sh b/ws/example/time_channel.sh deleted file mode 100755 index 3e29209..0000000 --- a/ws/example/time_channel.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -response=$(curl -s -X 'POST' \ - 'http://localhost:8080/api/v1/player/login' \ - -H 'accept: application/json' \ - -H 'Content-Type: application/json' \ - -d '{ - "username": "Player1", - "password": "1234" -}') - -token=$(echo "$response" | jq -r .token) -payload='{"$id": "RequestConnectionToken", "channel": "time"}' -response=$(echo "$payload" | websocat ws://localhost:8080/ws/connection -H "Authorization: $token") - -time_token=$(echo "$response" | jq -r .token) -websocat ws://localhost:8080/ws/time -H "Authorization: $time_token" diff --git a/ws/ws.yml b/ws/ws.yml index cb56075..69f9dcf 100644 --- a/ws/ws.yml +++ b/ws/ws.yml @@ -160,24 +160,6 @@ channels: description: | Channel for managing an active match messages: - CurrentUnixTime: - description: The Current time in Unix Time - payload: - type: object - additionalProperties: false - properties: - $id: - type: string - format: messageId - time: - type: integer - format: int64 - matchId: - type: string - required: - - $id - - time - - matchId RequestTowerPlacing: description: Requesting a placement of a tower payload: @@ -295,13 +277,6 @@ operations: $ref: "#/channels/matchmaking" messages: - $ref: "#/channels/matchmaking/messages/MatchEstablished" - matchUpdate: - title: MatchUpdate - action: receive - channel: - $ref: "#/channels/match" - messages: - - $ref: "#/channels/match/messages/CurrentUnixTime" towerPlacing: title: TowerPlacing action: send