-
Notifications
You must be signed in to change notification settings - Fork 0
Infrastructure
Note: From GUI view moving cards is only operation that is visible right after doing it. If server responds that operation was illegal then card is moved back to the original place. Example: undo is operation where on the client side only request is sent and response is returned in the form of the moving card/cards.
After operations like moving cards/undo, GUI must be freezed while the respond comes back from the server.
Client sends RegisterGameRequest
, server generates UUID and sends it back to the client using RegisterGameResponse
Client sends JoinGameRequest
with UUID of the game. Server checks if game exists, if no then it will be loaded from file. Then server sends multiple responses:
-
GameStateResponse
wherespectator
means if player is spectator or not. - multiple
UpdatePlayground
whereindex
is index of the playground and also there is state of the all decks in playground
Client sends GameMove
to the server, server sends:
-
GameMoveResponse
- which states that move was valid or not -
GameMove
- to propagate move to the all connected spectators
Client sends AddPlayground
request. Server generates new playground and sends UpdatePlayground
response to all connected clients, where index
is index of the playground.
Client sends ClosePlayground
request. Server closes playground base on the index and propagates this to all clients using ClosePlayground
response.
Client sends UndoRequest
, server sends GameMove
to the all connected clients
Client sends SaveRequest
and server saves game
Client sends LoadRequest
, server loads game from file and propagates it to the all connected clients using UpdatePlayground
Clients sends HintRequest
and server responds to the client with HintResponse