Update readme

This commit is contained in:
Eden Kirin
2023-03-26 14:50:32 +02:00
parent 4831f1e393
commit a45d76e9a5

View File

@ -76,48 +76,51 @@ actor "Player 2" as P2
actor "Player 3" as P3 actor "Player 3" as P3
package Masterpiece { package Masterpiece #seashell {
rectangle { rectangle "FairHopper Game Server" #lightcyan {
usecase Game as "FairHopper\nGame Server" usecase API as "API Server"
usecase Game as "Game Engine"
usecase WS as "WS Server" usecase WS as "WS Server"
} }
usecase Vis as "Visualisation\nService" usecase Vis as "Visualisation\nService"
} }
P1 -left-> Game: REST API usecase ExtVis1 as "Visualisation\nService"
P2 -left-> Game: REST API usecase ExtVis2 as "Visualisation\nService"
P3 -left-> Game: REST API
P1 -left-> API: REST API
P2 -left-> API: REST API
P3 -left-> API: REST API
API --> Game
Game --> WS: Game State Game --> WS: Game State
WS --> Vis: WebSockets WS --> Vis: WebSockets
WS --> ExtVis1: WebSockets
WS --> ExtVis2: WebSockets
``` ```
### WebSockets ### WebSockets
```plantuml ```plantuml
participant Game as "FairHopper\nGame Server" box "FairHopper Game Server" #lightcyan
participant Game as "Game Engine"
participant WS as "WS Server" participant WS as "WS Server"
participant Client1 as "Visualisation\nClient 1" endbox
participant Client2 as "Visualisation\nClient 2" participant Client1 as "Visualisation\nClient 1"
participant Client2 as "Visualisation\nClient 2"
Game ->o WS: Server Connect Game ->o WS: Send initial state
activate WS #coral
WS -> Game: Get game state
activate Game #yellow
Game -> WS: Game state
deactivate
deactivate
Client1 ->o WS: Client Connect Client1 ->o WS: Client connect
activate WS #coral activate WS #coral
WS -> Client1: Game state WS -> Client1: Game state
deactivate deactivate
Client2 ->o WS: Client Connect Client2 ->o WS: Client connect
activate WS #coral activate WS #coral
WS -> Client2: Game state WS -> Client2: Game state
deactivate deactivate
loop #lightyellow On game state change loop #lightyellow On game state change
Game ->o WS: Game state Game ->o WS: Game state
activate WS #coral activate WS #coral
WS o-> Client1: Game state WS o-> Client1: Game state