Skip to content

ADR 09 ‐ Multiplayer technology

Hugo Méndez Fernández edited this page Apr 8, 2024 · 1 revision

Status

  • Proposed
  • Accepted
  • Superseded

Context

We have to decide how the multiplayer service is being implemented.

Decision

We want to make a service to manage sockets to create the multiplayer game. Webapp must communicate with this service and this service with webapp.

This service has to manage the rooms of the games. Users must join each room. Then the service ask some questions to question service and sends them to each user. Then each user sends the number of correct answers and elapsed time. Finally, the service gets the winner user and sends it to each one.

For it we decided to use NodeJS because it uses an asynchronous, event-driven I/O model.

Consequences

  • Benefits:

    • Easy to implement: With NodeJS modules and WebSocket standard it is fast to implement.
    • Same language as frontend: The service uses the same programming language as the frontend.
  • Trade-offs:

    • Asynchronous complexity: The asynchronous code is more complex.

Compliance

We will implement and test the service functioning this way.

Notes

  • Original Author: @uo288543
  • Approval date: 08/04/2024
  • Approved by: All members
  • Superseded date: N/A
  • Last modified date: N/A
  • Modified by: N/A
  • Last modification: N/A