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

Restrict players to the game room in socketio server, by http server emits event on creating game #54

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

metalalive
Copy link
Collaborator

@metalalive metalalive commented Jan 24, 2024

Summary

This PR implements second part of the TODO list in #37 :

  • socketio server collects the events, to know all the ongoing games
  • http server maintains a shared socketio client sending all relevant events
  • rename AbstractRepository to AbstractGameRepository
  • implement (currently in-memory) room repository , so the socketio server knows all the ongoing games
  • check from the room repository when player attempts to initialize (or de-initialize) real-time communication (RTC) through the socketio event INIT (or DEINIT)
  • add new member to GameFuncCodes, for RTC endpoints (e.g. currently socketio)

@wingtkw , according to the previous discussion , if you happen to see this PR please help to review my code by the end of 25th. Jan 2024 , after that I will merge the PR first , you are still welcome to leave comment at here, or create another issue / discussion thread for any question about my code at here , thanks.

C.C. @KalpasWang , @liamlin1102
Feel free ask questions about the socket.io server-side implementation

… game

- socketio server collects the events, to know all the ongoing games
- http server maintains a shared socketio client sending all relavant
  events
- rename `AbstractRepository` to `AbstractGameRepository`
- TODO, implement room repository for real-time communication

Signed-off-by: T.H. <[email protected]>
- implement (currently in-memory) room repository , so the socketio
  server knows all the ongoing games
- check from the room repository when player attempts to initialize (or
  de-initialize) real-time communication (RTC) through the socketio
  event `INIT` (or `DEINIT`)
- add new member to `GameFuncCodes`, for RTC endpoints (e.g. currently
  `socketio`)

Signed-off-by: T.H. <[email protected]>
@metalalive metalalive added feature For those who propose to add new feature or modify existing features backend dev For back-end development related to this codebase labels Jan 24, 2024
@metalalive metalalive requested a review from wingtkw January 24, 2024 17:46
@metalalive metalalive self-assigned this Jan 24, 2024
Copy link
Collaborator Author

@metalalive metalalive left a comment

Choose a reason for hiding this comment

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

ok

@metalalive metalalive merged commit a134a67 into main Jan 25, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend dev For back-end development related to this codebase feature For those who propose to add new feature or modify existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant