Send player info with product purchase data

This commit is contained in:
Eden Kirin
2023-03-31 11:51:05 +02:00
parent 210a6aff7c
commit 659ca82d74
9 changed files with 141 additions and 98 deletions

View File

@ -100,6 +100,7 @@ WebSockets server runs on port **8011**. To run WS Server on different port, edi
### Architecture
```plantuml
scale 1024 width
actor "Player 1" as P1
actor "Player 2" as P2
actor "Player 3" as P3
@ -129,6 +130,7 @@ WS --> ExtVis2: WS Game State
### WebSockets
```plantuml
scale 1024 width
box "FairHopper Game Server" #lightcyan
participant Game as "Game Engine"
participant WS as "WS Server"
@ -136,6 +138,8 @@ endbox
participant Client1 as "Visualisation\nClient 1"
participant Client2 as "Visualisation\nClient 2"
== Player movement mode ==
Game ->o WS: Send initial state
Client1 ->o WS: Client connect
@ -155,6 +159,27 @@ loop #lightyellow On game state change
WS o-> Client2: Game state
deactivate
end
== Product purchase mode ==
Game -> WS: Purchase start
activate WS #coral
WS o-> Client1: Purchase start
WS o-> Client2: Purchase start
deactivate
loop #lightyellow Purchase countdown timer
Game ->o WS: Timer count down
activate WS #coral
WS o-> Client1: Purchase time left
WS o-> Client2: Purchase time left
deactivate
end
Game -> WS: Purchase done
activate WS #coral
WS o-> Client1: Purchase done
WS o-> Client2: Purchase done
deactivate
```