Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix : SSE 접속시 code name parsing 로직 수정 #125

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/java/mafia/mafiatogether/game/aspect/SseService.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import mafia.mafiatogether.common.annotation.PlayerInfo;
import mafia.mafiatogether.common.exception.AuthException;
import mafia.mafiatogether.common.exception.ExceptionCode;
import mafia.mafiatogether.common.resolver.PlayerInfoDto;
import mafia.mafiatogether.game.application.dto.response.GameStatusResponse;
import mafia.mafiatogether.game.domain.Game;
import mafia.mafiatogether.game.domain.GameRepository;
Expand Down Expand Up @@ -45,8 +46,9 @@ public ResponseEntity<SseEmitter> subscribe(final ProceedingJoinPoint joinPoint)
String[] codeAndName = new String[2];
for (int i = 0; i < parameterAnnotations.length; i++) {
if (hasPlayerInfo(parameterAnnotations[i])) {
codeAndName[0] = args[i].toString();
codeAndName[1] = args[i].toString();
PlayerInfoDto playerInfoDto = (PlayerInfoDto) args[i];
codeAndName[0] = playerInfoDto.code();
codeAndName[1] = playerInfoDto.name();
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public JobTarget() {
public String findTarget() {
final String mafiaTarget = findJobTargetBy(JobType.MAFIA);
final String doctorTarget = findJobTargetBy(JobType.DOCTOR);
if (mafiaTarget.equals(doctorTarget)) {
if (mafiaTarget == null || mafiaTarget.equals(doctorTarget)) {
return null;
}
return mafiaTarget;
Expand Down
Loading