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

實作最後一人離開房間後則自動關閉房間 #149

Merged
merged 3 commits into from
Aug 20, 2023

Conversation

ted791029
Copy link
Contributor

@ted791029 ted791029 commented Aug 17, 2023

Why need this change? / Root cause:

  • Readiness oriented room host

Changes made:

  • Room related

Test Scope / Change impact:

  • RoomController

Issue

Copy link
Collaborator

@Wally5077 Wally5077 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review done.

Comment on lines 18 to 20
room.leaveRoom(player.id)
roomRepository.leaveRoom(room)
if (room.isEmpty()) roomRepository.deleteById(room.roomId!!)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

room.leaveRoom(player)

if (room.isEmpty()) {
    roomRepository.deleteById(room)
} else {
    roomRepository.leaveRoom(room)
}

Copy link
Collaborator

@Wally5077 Wally5077 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review done.

roomRepository.leaveRoom(room)

if (room.isEmpty()) {
roomRepository.deleteById(room.roomId!!)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

昨天忘了補充,請幫我將 deleteById 改成下方這樣 🙏

roomRepository.closeRoom(room)

Comment on lines 20 to 23
if (room.isEmpty()) {
roomRepository.deleteById(room.roomId!!)
} else {
roomRepository.leaveRoom(room)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT:可以考慮用 when

@sonarcloud
Copy link

sonarcloud bot commented Aug 19, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Collaborator

@Wally5077 Wally5077 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ricksu978 ricksu978 merged commit d245ee1 into main Aug 20, 2023
5 checks passed
@ricksu978 ricksu978 deleted the feature/auto-closed-room branch August 20, 2023 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

最後一人離開房間後則自動關閉房間
4 participants