Skip to content

Commit

Permalink
Merge pull request #139 from HandTris/#137
Browse files Browse the repository at this point in the history
TetrisMessageReq ํ•„๋“œ ์ˆ˜์ •
  • Loading branch information
otfeb authored Jul 16, 2024
2 parents 1a23c2e + b6455f1 commit 23147a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
11 changes: 4 additions & 7 deletions src/main/java/jungle/HandTris/presentation/TetrisController.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public void roomOwnerInfo(@DestinationVariable("roomCode") String roomCode, Simp

@MessageMapping("/{roomCode}/disconnect")
public void handleDisconnect(SimpMessageHeaderAccessor headerAccessor, @DestinationVariable(value = "roomCode") String roomCode) {
System.out.println("\n========================================= controller disconnect send =========================================");

// playing ์ค‘์ธ ๊ฒŒ์ž„์—์„œ ํƒˆ์ฃผํ•œ ๊ฒฝ์šฐ
// message์—์„œ isStart ํ™•์ธ
Expand All @@ -66,9 +65,9 @@ public void handleDisconnect(SimpMessageHeaderAccessor headerAccessor, @Destinat
{"#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "#303030", "orange", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "#303030", "orange", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "orange", "orange", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030"},
Expand All @@ -81,7 +80,7 @@ public void handleDisconnect(SimpMessageHeaderAccessor headerAccessor, @Destinat
{"#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030"},
{"#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030", "#303030"}};
// ํƒˆ์ฃผ ์œ ์ €์˜ ์ƒ๋Œ€์—๊ฒŒ ์Šน๋ฆฌ ๋ฉ”์„ธ์ง€ ๋ณด๋‚ด๊ธฐ ------------------------------
TetrisMessageReq win = new TetrisMessageReq(emptyBoard, true, false, false);
TetrisMessageReq win = new TetrisMessageReq(emptyBoard, true, false, false, false);
String otherUser = headerAccessor.getHeader("otherUser").toString();
messagingTemplate.convertAndSendToUser(otherUser, "queue/tetris/" + roomCode, win);
}
Expand All @@ -98,8 +97,6 @@ public void handleDisconnect(SimpMessageHeaderAccessor headerAccessor, @Destinat
RoomOwnerRes roomOwnerRes = tetrisService.checkRoomOwnerAndReady(roomCode);
messagingTemplate.convertAndSend("/topic/owner/" + roomCode, roomOwnerRes);
}

System.out.println("\n========================================= disconnect send ์ข…๋ฃŒ =========================================");
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package jungle.HandTris.presentation.dto.request;

public record TetrisMessageReq(String[][] board, boolean isEnd, boolean isAttack, boolean isGaugeFull) {
public record TetrisMessageReq(String[][] board, boolean isEnd, boolean isAddAttack, boolean isFlipAttack,
boolean isDonutAttack) {
}
2 changes: 1 addition & 1 deletion src/main/resources/application-jwt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ spring:
jwt:
secret: ENC(PU1sudx/G+oeBctL3FHHaRiQy+rpqRjUGCKICeDFBYi7OqL5yyowKtayBHa/QiElf64wH6hLaXwXP67yZ5amsUTH/+FLFnVHUmWqgJb4L9D1Ud3WSk5PTk+47bAfWjyc7mvMjUhYUYE=)
access:
expiration: 3600000 # 1h
expiration: 36000000 # 10h
header: Authorization
subject: AccessToken
refresh:
Expand Down

0 comments on commit 23147a9

Please sign in to comment.