From 9f678081397aa26677b433b7373cb4d5960b1d28 Mon Sep 17 00:00:00 2001 From: punchready Date: Mon, 26 Jul 2021 00:00:47 +0200 Subject: [PATCH] fix: add gamestate event to all responses --- .../main/java/uulm/teamname/marvelous/server/lobby/Lobby.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java index 8d55469..6565c3e 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java @@ -219,10 +219,11 @@ public class Lobby { if (!accepted.isEmpty()) { Logger.debug("Accepting requests from participant '{}', broadcasting events to all except source", source.id.getName()); + accepted.add(game.getGameStateEvent()); connection.broadcastToAllExcept(source, accepted.toArray(new Event[0])); Logger.trace("Adding ack and sending back to originParticipant"); - accepted.add(0, new EventBuilder(EventType.Ack).buildGameStateEvent()); + accepted.add(0, new EventBuilder(EventType.Ack).buildGameEvent()); connection.sendEvents(source, accepted.toArray(new Event[0])); } badRequests = 0;