#Websocket - Manage State

6 messages · Page 1 of 1 (latest)

exotic plaza
#

Hi guys, this is my fisrt time using webscoket with nestjs, and I'm trying to buil a multiplayer card game, where it would be possible to create and join rooms to play the game.

My question is how is the best way to manage the state of the rooms and the state of the game.

Is anyone here have a suggestion or an article that covers this case?

For now I have for example a Rooms Service ,Romms Gateway, GameService and GameGateway

exotic plaza
exotic plaza
exotic plaza
#

anyone?

humble birch
#

Going to brainstorm a bit here, I wonder if it’s best to create some sort of Global Service available like “GameManager” or something that keeps track of each game started…?

#

Or another parent of that service that spawns and keeps track of each game…