From 76b426bdb9cc629412ddaa44c5e4095732398a5a Mon Sep 17 00:00:00 2001 From: yhpark95 <98851575+yhpark95@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:44:03 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=88=9C=EA=B0=84=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=20=EC=B6=94=EA=B0=80=20#69?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../game/controller/GameController.java | 3 +++ .../game/dto/response/GameTeleportResponse.java | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 be/src/main/java/codesquad/gaemimarble/game/dto/response/GameTeleportResponse.java diff --git a/be/src/main/java/codesquad/gaemimarble/game/controller/GameController.java b/be/src/main/java/codesquad/gaemimarble/game/controller/GameController.java index fa92bc7..53e5e2f 100644 --- a/be/src/main/java/codesquad/gaemimarble/game/controller/GameController.java +++ b/be/src/main/java/codesquad/gaemimarble/game/controller/GameController.java @@ -30,6 +30,7 @@ import codesquad.gaemimarble.game.dto.response.GameCellResponse; import codesquad.gaemimarble.game.dto.response.GameEventNameResponse; import codesquad.gaemimarble.game.dto.response.GameRoomCreateResponse; +import codesquad.gaemimarble.game.dto.response.GameTeleportResponse; import codesquad.gaemimarble.game.dto.response.userStatusBoard.GameUserBoardResponse; import codesquad.gaemimarble.game.entity.Player; import codesquad.gaemimarble.game.entity.TypeConstants; @@ -167,6 +168,8 @@ private void sendCellArrival(Long gameId, String playerId) { private void sendTeleport(GameTeleportRequest gameTeleportRequest) { gameService.teleport(gameTeleportRequest); sendCellArrival(gameTeleportRequest.getGameId(), gameTeleportRequest.getPlayerId()); + socketDataSender.send(gameTeleportRequest.getGameId(), new ResponseDTO<>(TypeConstants.TELEPORT, + GameTeleportResponse.builder().location(gameTeleportRequest.getLocation()).build())); } private void sendRandomEvents(GameEventRequest gameEventRequest) { diff --git a/be/src/main/java/codesquad/gaemimarble/game/dto/response/GameTeleportResponse.java b/be/src/main/java/codesquad/gaemimarble/game/dto/response/GameTeleportResponse.java new file mode 100644 index 0000000..2943999 --- /dev/null +++ b/be/src/main/java/codesquad/gaemimarble/game/dto/response/GameTeleportResponse.java @@ -0,0 +1,14 @@ +package codesquad.gaemimarble.game.dto.response; + +import lombok.Builder; +import lombok.Getter; + +@Getter +public class GameTeleportResponse { + private final Integer location; + + @Builder + private GameTeleportResponse(Integer location) { + this.location = location; + } +}