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

feat(game): add game queue matchmaking logics #93

Merged
merged 7 commits into from
Dec 21, 2023
Merged

feat(game): add game queue matchmaking logics #93

merged 7 commits into from
Dec 21, 2023

Conversation

cjho0316
Copy link
Contributor

@cjho0316 cjho0316 commented Dec 21, 2023

  • 매치메이킹을 위한 게임 큐를 3가지 구성했습니다.
  1. 래더게임 큐(LADDER)
  2. 노말모드 게임 큐(NORMAL_MATCHING)
  3. 스페셜모드 게임 큐(SPECIAL_MATCHING)
  • 유저가 2명이상 존재하게 된다면 매치메이킹 로직을 통한 gameDB가 구성됩니다.
  1. 게임 큐에서 유저가 2명 이상일때 gameQueue에서 유저를 뽑아서 할당해줍니다.(shift)
  2. 뽑아온 유저중 channelSocketId가 존재하지 않는다면 gameQueue에 존재하는 다른유저를 뽑아와서 해당 player을 대체합니다.
  3. 유저에게 gameId를 emit 해줍니다.
  • 매치메이킹 취소로직을 구성했습니다.
  1. gameType을 받고, 큐에 유저가 있는지 검사합니다.
  2. 유저가 존재한다면, 유저를 큐에서 삭제합니다. (splice)
  3. 유저가 존재하지 않는다면 매칭큐에 존재하지 않는다는 에러메세지를 던집니다.

@cjho0316 cjho0316 self-assigned this Dec 21, 2023
@tomatozil tomatozil merged commit fb7bcd5 into main Dec 21, 2023
4 checks passed
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.

3 participants