Skip to content

Commit

Permalink
feat: 순간이동 응답 추가 #69
Browse files Browse the repository at this point in the history
  • Loading branch information
yhpark95 committed Nov 2, 2023
1 parent eba2f8d commit 76b426b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 76b426b

Please sign in to comment.